﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace DimensionalMeasurement
{
    public partial class FormSet : Form
    {
        //  public static FormSet Instance { get; } = new FormSet();

        private static FormSet _instance;
        public static FormSet Instance
        {
            get
            {
                if (_instance == null)
                {
                    _instance = new FormSet();
                }
                return _instance;
            }
            set
            {
                _instance = value;
            }
        }


        bool Ui, UiCamera;
        ToolTip tp;
        private FormSet()
        {
            InitializeComponent();
            SetStyle(ControlStyles.AllPaintingInWmPaint, true);
            SetStyle(ControlStyles.OptimizedDoubleBuffer, true);

            #region 气泡提示
            tp = new ToolTip();
            tp.SetToolTip(lNJPHeadWidth, "极片头部宽度，默认使用左下相机与右下相机计算得到（极耳端为头部）");
            tp.SetToolTip(lNJPTailWidth, "极片尾部宽度，默认使用左上相机与右上相机计算得到（非极耳端为尾部）");
            tp.SetToolTip(lNJPHeadLength, "极片头部长度，默认使用左上相机与左下相机计算得到");
            tp.SetToolTip(lNJPTailLength, "极片尾部长度，默认使用左上相机与右上相机计算得到");
            tp.SetToolTip(lNDiagonal, "对角线差值，（左上相机与右下相机对角线）减去（右上相机与左下相机对角线)的差值");
            tp.SetToolTip(lNLeftUpAngle, "左上相机极片横边与竖边的相交垂直角度");
            tp.SetToolTip(lNRightUpAngle, "右上相机极片横边与竖边的相交垂直角度");
            tp.SetToolTip(lPJPHeadWidth, "极片头部宽度，默认使用左下相机与右下相机计算得到（极耳端为头部）");
            tp.SetToolTip(lPJPTailWidth, "极片尾部宽度，默认使用左上相机与右上相机计算得到（非极耳端为尾部）");
            tp.SetToolTip(lPJPHeadLength, "极片头部长度，默认使用左上相机与左下相机计算得到");
            tp.SetToolTip(lPJPTailLength, "极片尾部长度，默认使用左上相机与右上相机计算得到");
            tp.SetToolTip(lPDiagonal, "对角线差值，（左上相机与右下相机对角线）减去（右上相机与左下相机对角线)的差值");
            tp.SetToolTip(lPLeftUpAngle, "左上相机极片横边与竖边的相交垂直角度");
            tp.SetToolTip(lPRightUpAngle, "右上相机极片横边与竖边的相交垂直角度");
            tp.SetToolTip(lNJELocation, "当前负极极耳在哪个相机的位置");
            tp.SetToolTip(lPJELocation, "当前正极极耳在哪个相机的位置");
            tp.SetToolTip(lNJEColumnErosion, "检测到的极耳内缩一定的位置，值越大内缩越大（XY值同时为0则不进行内缩，并只能保留一位小数）");
            tp.SetToolTip(lNJERowErosion, "检测到的极耳内缩一定的位置，值越大内缩越大（XY值同时为0则不进行内缩，并只能保留一位小数)");
            tp.SetToolTip(lPJEColumnErosion, "检测到的极耳内缩一定的位置，值越大内缩越大（XY值同时为0则不进行内缩，并只能保留一位小数）");
            tp.SetToolTip(lPJERowErosion, "检测到的极耳内缩一定的位置，值越大内缩越大（XY值同时为0则不进行内缩，并只能保留一位小数)");
            tp.SetToolTip(lNJERectangularity, "检测到的极耳是否为一个完整的矩形，越完整值越大（值为0则不进行检测）");
            tp.SetToolTip(lPJERectangularity, "检测到的极耳是否为一个完整的矩形，越完整值越大（值为0则不进行检测）");
            tp.SetToolTip(lNJEGapAreaMax, "检测极耳是否存在缺口（值为0则不进行检测）");
            tp.SetToolTip(lPJEGapAreaMax, "检测极耳是否存在缺口（值为0则不进行检测）");

            #endregion

        }

        public FormSet(bool b)
        {
            InitializeComponent();
            SetStyle(ControlStyles.AllPaintingInWmPaint, true);
            SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
        }



        #region 重写函数
        //设置CreateParams的ExStyle属性为0x02000000(WS_EX_COMPOSITED),会把窗体与其子窗体都开启双缓冲
        //这种方式不会加快绘制过程,当发生绘制时,窗体只是停留在不可见的状态,当绘制完成后就会在屏幕上弹出
        protected override CreateParams CreateParams
        {
            get
            {
                CreateParams cp = base.CreateParams;
                cp.ExStyle |= 0x02000000;
                return cp;
            }
        }



        #endregion

        private bool IsLoaded = false;
        protected override void OnSizeChanged(EventArgs e)
        {
            base.OnSizeChanged(e);
            RefreshLayout();
        }
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            RefreshLayout();
            IsLoaded = true;

        }
        private void RefreshLayout()
        {

            try
            {
                if (IsLoaded)
                {
                    return;
                }
                tabSet.Top = -tabSet.ItemSize.Height - 5;
                tabSet.Left = -5;
                tabSet.Width = tabSet.Parent.Width + 10;
                tabSet.Height = tabSet.Parent.Height + tabSet.ItemSize.Height + 10;
                tabSet.Refresh();
            }
            catch
            {
            }
        }

        #region 函数调用
        /// <summary>
        /// 查询用户信息
        /// </summary>
        private void QueryUserInfo()
        {
            DataTable dt = MySQLHelper.Select(PublicSet.Connection, "SELECT * FROM tb_user");
            UserInfo[] userInfos = new UserInfo[dt.Rows.Count];
            for (int i = 0; i < dt.Rows.Count; ++i)
            {
                userInfos[i].name = dt.Rows[i]["name"].ToString();
                userInfos[i].password = dt.Rows[i]["password"].ToString();
                userInfos[i].power = (Power)dt.Rows[i]["power"];
            }
            dGVUserInfo.Rows.Clear();
            foreach (UserInfo item in userInfos)
            {
                dGVUserInfo.Rows.Add(item.name, item.power);
            }
        }
        #endregion

        #region 数据面板控件的隐藏方法
        int[,] AllLoctionN;//负极定义一个二维数组存储所有label的位置
        int[,] AllLoctionP;//正极定义一个二维数组存储所有label的位置
        Control[] queueAllConN; //负极存储所有的控件,这个变动
        Control[] queueAllConP; //正极存储所有的控件,这个变动
        Queue<Control> queueConN;//负极所有visible为false的控件，采用先进先出的模式
        Queue<Control> queueConP;//正极所有visible为false的控件，采用先进先出的模式

        bool flag;
        /// <summary>
        /// 设置控件位置
        /// </summary>
        /// <param name="c">控件的容器</param>
        /// <param name="distance">每个控件之间的距离</param>
        /// <param name="ControlCount">容器里需要排列的控件数量</param>
        /// <param name="step">每隔几个控件开始遍历开始排列控件(或者是每一行里需要排列的控件数量)</param>
        /// <param name="CustomNaming"> 是否存在自定义命名这一控件</param>
        private void SetControlLocation(Control c, int distance, int ControlCount, int step, bool CustomNaming)
        {
            Control control = null;//每一个控件信息
            Control currCon = null;//取出队列的值

            if (!flag)
            {
                flag = true;
                queueConN = new Queue<Control>();//所有visible为false的控件，采用先进先出的模式
                AllLoctionN = new int[c.Controls.Count, 2];//定义一个二维数组存储所有label的位置
                queueAllConN = new Control[c.Controls.Count]; ;//存储所有的控件,这个变动
                for (int j = 0; j < c.Controls.Count; j++)
                {
                    foreach (Control item in c.Controls)
                    {
                        Match match = Regex.Match(item.Tag.ToString(), @"([^\d]+)(\d+)");
                        if (match.Success)
                        {
                            // 数值
                            string numberString = match.Groups[2].Value;
                            if (int.Parse(numberString) - 1 == j)
                            {
                                AllLoctionN[j, 0] = item.Location.X;
                                AllLoctionN[j, 1] = item.Location.Y;
                                break;
                            }
                            else
                            {
                                continue;
                            }
                        }
                    }
                }
                for (int j = 0; j < c.Controls.Count; j++)
                {
                    foreach (Control item in c.Controls)
                    {
                        Match match = Regex.Match(item.Tag.ToString(), @"([^\d]+)(\d+)");
                        if (match.Success)
                        {
                            // 数值
                            string numberString = match.Groups[2].Value;
                            if (int.Parse(numberString) - 1 == j)
                            {
                                queueAllConN[j] = item;
                                break;
                            }
                            else
                            {
                                continue;
                            }
                        }
                    }
                }
            }

            int count = 0;
            count = 0;
            for (int j = 1; j <= queueAllConN.Length; j++)
            {
                count++;
                try
                {
                    if ((j == 1 || count == step) && j <= ControlCount)
                    {
                        count = 0;
                        control = queueAllConN[j - 1];

                        if (control.Visible)
                        {
                            if (queueConN.Count > 0)//前面存在不可见的控件
                            {
                                currCon = queueConN.Dequeue();//取出来的前面一个的控件
                                queueConN.Enqueue(control);//将当前的控件再放进去
                                Match match = Regex.Match(currCon.Tag.ToString(), @"([^\d]+)(\d+)");
                                string numberString = "";
                                if (match.Success)
                                {
                                    // 数值
                                    numberString = match.Groups[2].Value;
                                }
                                //每一列的第一个控件位置
                                control.Location = new Point(AllLoctionN[int.Parse(numberString) - 1, 0], AllLoctionN[int.Parse(numberString) - 1, 1]);

                                for (int i = 1; i < step; i++)
                                {
                                    if (i == (step - 2))
                                    {
                                        currCon = control;
                                        control = queueAllConN[j + i - 1];//当前控件对应的说明
                                        control.Location = new Point(currCon.Location.X + distance, currCon.Location.Y + 5);
                                    }
                                    else if ((i == (step - 1)) && CustomNaming)
                                    {
                                        currCon = control;
                                        control = queueAllConN[j + i - 1];//当前控件对应的说明
                                        control.Location = new Point(currCon.Location.X + distance / 2, currCon.Location.Y - 5);
                                    }
                                    else
                                    {
                                        currCon = control;
                                        control = queueAllConN[j + i - 1];//当前控件对应的说明
                                        control.Location = new Point(currCon.Location.X + distance, currCon.Location.Y);
                                    }
                                }


                                //int q = 0;
                                //if (step > 1)
                                //{
                                //    ++q;
                                //    currCon = control;
                                //    control = queueAllConN[j];//当前控件对应的说明
                                //    control.Location = new Point(currCon.Location.X + distance, currCon.Location.Y);
                                //}

                                //if (step > 2)
                                //{
                                //    ++q;
                                //    currCon = control;
                                //    control = queueAllConN[j + q];//当前控件对应的说明
                                //    control.Location = new Point(currCon.Location.X + distance, currCon.Location.Y);
                                //}

                                //if (step > 3)
                                //{
                                //    ++q;
                                //    currCon = control;
                                //    control = queueAllConN[j + q];//当前控件对应的说明
                                //    control.Location = new Point(currCon.Location.X + distance, currCon.Location.Y);
                                //}

                                //if (step > 4&& (step-2==j+3))
                                //{
                                //    ++q;
                                //    currCon = control;
                                //    control = queueAllConN[j + q];//当前控件对应的说明
                                //    control.Location = new Point(currCon.Location.X + distance, currCon.Location.Y);
                                //}

                                //if (CustomNaming)
                                //{
                                //    ++q;
                                //    currCon = control;
                                //    control = queueAllConN[j + q];//当前控件对应的说明
                                //    control.Location = new Point(currCon.Location.X + distance / 2, currCon.Location.Y);
                                //}


                            }
                            else
                            {
                                //每一列的第一个控件位置
                                control.Location = new Point(AllLoctionN[j - 1, 0], AllLoctionN[j - 1, 1]);
                                for (int i = 1; i < step; i++)
                                {
                                    if (i == (step - 2))
                                    {
                                        currCon = control;
                                        control = queueAllConN[j + i - 1];//当前控件对应的说明
                                        control.Location = new Point(currCon.Location.X + distance, currCon.Location.Y + 5);
                                    }
                                    else if ((i == (step - 1)) && CustomNaming)
                                    {
                                        currCon = control;
                                        control = queueAllConN[j + i - 1];//当前控件对应的说明
                                        control.Location = new Point(currCon.Location.X + distance / 2, currCon.Location.Y - 5);
                                    }
                                    else
                                    {
                                        currCon = control;
                                        control = queueAllConN[j + i - 1];//当前控件对应的说明
                                        control.Location = new Point(currCon.Location.X + distance, currCon.Location.Y);
                                    }
                                }




                                //int q = 0;
                                //if (step > 1)
                                //{
                                //    currCon = control;
                                //    control = queueAllConN[j];//当前控件对应的说明
                                //    control.Location = new Point(currCon.Location.X + distance, currCon.Location.Y);
                                //}
                                //if (step > 2)
                                //{
                                //    ++q;
                                //    currCon = control;
                                //    control = queueAllConN[j + q];//当前控件对应的说明
                                //    control.Location = new Point(currCon.Location.X + distance, currCon.Location.Y);
                                //}
                                //if (step > 3)
                                //{
                                //    ++q;
                                //    currCon = control;
                                //    control = queueAllConN[j + q];//当前控件对应的说明
                                //    control.Location = new Point(currCon.Location.X + distance, currCon.Location.Y);
                                //}

                                //if (step > 4)
                                //{
                                //    ++q;
                                //    currCon = control;
                                //    control = queueAllConN[j + q];//当前控件对应的说明
                                //    control.Location = new Point(currCon.Location.X + distance, currCon.Location.Y+5);
                                //}
                                //if (CustomNaming)
                                //{
                                //    ++q;
                                //    currCon = control;
                                //    control = queueAllConN[j + q];//当前控件对应的说明
                                //    control.Location = new Point(currCon.Location.X + distance / 2, currCon.Location.Y-5);
                                //}
                            }
                            continue;
                        }
                        else
                        {
                            queueConN.Enqueue(control);//将当前的控件再放进去
                        }
                    }
                }
                catch (Exception ex)
                {

                    throw;
                }
            }
            queueConN.Clear();
        }

        /// <summary>
        /// 设置正极数据面板控件位置
        /// </summary>
        private void SetLabelLocationP()
        {
            //Control control = null;//每一个控件信息
            //Control currCon = null;//取出队列的值
            //Panel p = PublicSet.Myset.DetectMode == "8相机正负双测" ? splitContainer1.Panel2 : splitContainer2.Panel2;

            //if (!flagP)
            //{
            //    flagP = true;
            //    queueConP = new Queue<Control>();//所有visible为false的控件，采用先进先出的模式
            //    AllLoctionP = new int[p.Controls.Count, 2];//定义一个二维数组存储所有label的位置
            //    queueAllConP = new Control[p.Controls.Count]; ;//存储所有的控件,这个变动
            //    for (int j = 0; j < p.Controls.Count; j++)
            //    {
            //        foreach (Control item in p.Controls)
            //        {

            //            if (int.Parse(item.Tag.ToString()) - 1 == j)
            //            {
            //                AllLoctionP[j, 0] = item.Location.X;
            //                AllLoctionP[j, 1] = item.Location.Y;
            //                break;
            //            }
            //            else
            //            {
            //                continue;
            //            }

            //        }
            //    }
            //    for (int j = 0; j < p.Controls.Count; j++)
            //    {
            //        foreach (Control item in p.Controls)
            //        {

            //            if (int.Parse(item.Tag.ToString()) - 1 == j)
            //            {
            //                queueAllConP[j] = item;
            //                break;
            //            }
            //            else
            //            {
            //                continue;
            //            }


            //        }
            //    }
            //}
            //Pstandby6.Visible = true; Pstandby7.Visible = true; Pstandby8.Visible = true;
            //Pstandby6_Four.Visible = true; Pstandby7_Four.Visible = true; Pstandby8_Four.Visible = true;
            //int distance = PublicSet.Myset.DetectMode == "8相机正负双测" ? label100.Location.X - label101.Location.X : label400.Location.X - label401.Location.X;
            //int count = 0, count1 = 0; ;
            //count = 0;
            //for (int j = 1; j < queueAllConP.Length; j++)
            //{
            //    count++;
            //    if ((j == 1 || count == 3) && j < (PublicSet.Myset.DetectMode == "8相机正负双测" ? 96 : 93))
            //    {
            //        count = 0;
            //        control = queueAllConP[j - 1];

            //        if (control.Visible)
            //        {
            //            if (queueConP.Count > 0)//前面存在不可见的控件
            //            {
            //                currCon = queueConP.Dequeue();//取出来的前面一个的控件
            //                queueConP.Enqueue(control);//将当前的控件再放进去
            //                control.Location = new Point(AllLoctionP[int.Parse(currCon.Tag.ToString()) - 1, 0], AllLoctionP[int.Parse(currCon.Tag.ToString()) - 1, 1]);

            //                currCon = control;
            //                control = queueAllConP[j];//当前控件对应的说明
            //                control.Location = new Point(currCon.Location.X - distance - 5, currCon.Location.Y);

            //                currCon = control;
            //                control = queueAllConP[j + 1];//当前控件对应的说明
            //                control.Location = new Point(currCon.Location.X - distance, currCon.Location.Y);
            //            }
            //            else
            //            {
            //                if (count1 < (PublicSet.Myset.DetectMode == "8相机正负双测" ? 3 : 2))
            //                {
            //                    count1++;
            //                    distance = PublicSet.Myset.DetectMode == "8相机正负双测" ? label100.Location.X - label101.Location.X : label400.Location.X - label401.Location.X;


            //                    control.Location = new Point(AllLoctionP[j - 1, 0], AllLoctionP[j - 1, 1]);//前一个的控件位置赋值给当前位置
            //                    currCon = control;
            //                    control = queueAllConP[j];//当前控件对应的说明
            //                    control.Location = new Point(currCon.Location.X - distance, currCon.Location.Y);

            //                    currCon = control;
            //                    control = queueAllConP[j + 1];//当前控件对应的说明
            //                    control.Location = new Point(currCon.Location.X - distance, currCon.Location.Y);
            //                }
            //                else
            //                {
            //                    control.Location = new Point(AllLoctionP[j - 1, 0], AllLoctionP[j - 1, 1]);//前一个的控件位置赋值给当前位置
            //                    currCon = control;
            //                    control = queueAllConP[j];//当前控件对应的说明
            //                    control.Location = new Point(currCon.Location.X - distance - 5, currCon.Location.Y);

            //                    currCon = control;
            //                    control = queueAllConP[j + 1];//当前控件对应的说明
            //                    control.Location = new Point(currCon.Location.X - distance, currCon.Location.Y);
            //                }
            //            }
            //            continue;
            //        }
            //        else
            //        {
            //            queueConP.Enqueue(control);//将当前的控件再放进去
            //        }

            //    }
            //}
            //Pstandby6.Visible = false; Pstandby7.Visible = false; Pstandby8.Visible = false;
            //Pstandby6_Four.Visible = false; Pstandby7_Four.Visible = false; Pstandby8_Four.Visible = false;
            //queueConP.Clear();


        }

        #endregion


        #region 设置ui

        /// <summary>
        /// 相机设置ui
        /// </summary>
        public void CameraSetUI()
        {
            if (UiCamera) return;
            UiCamera = true;

            cbNLeftUpCamera.Items.Clear();
            cbNRightUpCamera.Items.Clear();
            cbNLeftDownCamera.Items.Clear();
            cbNRightDownCamera.Items.Clear();
            cbPRightUpCamera.Items.Clear();
            cbPLeftDownCamera.Items.Clear();
            cbPRightDownCamera.Items.Clear();
            cbPLeftUpCamera.Items.Clear();

            cbNLeftUpCamera.Items.AddRange(PublicSet.AllList);
            cbNRightUpCamera.Items.AddRange(PublicSet.AllList);
            cbNLeftDownCamera.Items.AddRange(PublicSet.AllList);
            cbNRightDownCamera.Items.AddRange(PublicSet.AllList);
            cbPLeftUpCamera.Items.AddRange(PublicSet.AllList);
            cbPRightUpCamera.Items.AddRange(PublicSet.AllList);
            cbPLeftDownCamera.Items.AddRange(PublicSet.AllList);
            cbPRightDownCamera.Items.AddRange(PublicSet.AllList);


            cbPJELocation.Text = PublicSet.Myset.PJELocation; cbNJELocation.Text = PublicSet.Myset.NJELocation;
            cbPJELocation1.Text = PublicSet.Myset.PJELocation1; cbNJELocation1.Text = PublicSet.Myset.NJELocation1;

            cbNLeftUpCamera.Text = PublicSet.Cameraset.NLeftUpCamera;
            cbNRightUpCamera.Text = PublicSet.Cameraset.NRightUpCamera;
            cbNLeftDownCamera.Text = PublicSet.Cameraset.NLeftDownCamera;
            cbNRightDownCamera.Text = PublicSet.Cameraset.NRightDownCamera;
            cbPLeftUpCamera.Text = PublicSet.Cameraset.PLeftUpCamera;
            cbPRightUpCamera.Text = PublicSet.Cameraset.PRightUpCamera;
            cbPLeftDownCamera.Text = PublicSet.Cameraset.PLeftDownCamera;
            cbPRightDownCamera.Text = PublicSet.Cameraset.PRightDownCamera;

            //像素比列
            tbNLeftUpCamreraPixelRatio.Text = PublicSet.Cameraset.NLeftUpCamreraPixelRatio.ToString();
            tbNRightUpCamreraPixelRatio.Text = PublicSet.Cameraset.NRightUpCamreraPixelRatio.ToString();
            tbNLeftDownCamreraPixelRatio.Text = PublicSet.Cameraset.NLeftDownCamreraPixelRatio.ToString();
            tbNRightDownCamreraPixelRatio.Text = PublicSet.Cameraset.NRightDownCamreraPixelRatio.ToString();
            tbPLeftUpCamreraPixelRatio.Text = PublicSet.Cameraset.PLeftUpCamreraPixelRatio.ToString();
            tbPRightUpCamreraPixelRatio.Text = PublicSet.Cameraset.PRightUpCamreraPixelRatio.ToString();
            tbPLeftDownCamreraPixelRatio.Text = PublicSet.Cameraset.PLeftDownCamreraPixelRatio.ToString();
            tbPRightDownCamreraPixelRatio.Text = PublicSet.Cameraset.PRightDownCamreraPixelRatio.ToString();
            //自定义命名
            tbNLeftUpCamreraName.Text = PublicSet.Cameraset.NLeftUpCamreraName;
            tbNRightUpCamreraName.Text = PublicSet.Cameraset.NRightUpCamreraName;
            tbNLeftDownCamreraName.Text = PublicSet.Cameraset.NLeftDownCamreraName;
            tbNRightDownCamreraName.Text = PublicSet.Cameraset.NRightDownCamreraName;
            tbPLeftUpCamreraName.Text = PublicSet.Cameraset.PLeftUpCamreraName;
            tbPRightUpCamreraName.Text = PublicSet.Cameraset.PRightUpCamreraName;
            tbPLeftDownCamreraName.Text = PublicSet.Cameraset.PLeftDownCamreraName;
            tbPRightDownCamreraName.Text = PublicSet.Cameraset.PRightDownCamreraName;
            if (PublicSet.Myset.DetectMode == "2相机正负双测")
            {
                //负极右上右下相机禁用
                cbNRightUpCamera.Enabled = false;
                tbNRightUpCamreraPixelRatio.Enabled = false;
                tbNRightUpCamreraName.Enabled = false;
                cbNRightDownCamera.Enabled = false;
                tbNRightDownCamreraPixelRatio.Enabled = false;
                tbNRightDownCamreraName.Enabled = false;
                //正极左上左下相机禁用
                cbPLeftUpCamera.Enabled = false;
                tbPLeftUpCamreraPixelRatio.Enabled = false;
                tbPLeftUpCamreraName.Enabled = false;
                cbPLeftDownCamera.Enabled = false;
                tbPLeftDownCamreraPixelRatio.Enabled = false;
                tbPLeftDownCamreraName.Enabled = false;
                return;
            }
            if ((PublicSet.Myset.DetectMode == "3相机正负单测" || PublicSet.Myset.DetectMode == "4相机正负单测") && PublicSet.Myset.NegativeSwitch)
            {
                //相机标识
                cbNLeftUpCamera.Enabled = true;
                cbNRightUpCamera.Enabled = true;
                cbNLeftDownCamera.Enabled = true;
                cbNRightDownCamera.Enabled = PublicSet.Myset.DetectMode == "3相机正负单测" ? false : true;
                cbPLeftUpCamera.Enabled = false;
                cbPRightUpCamera.Enabled = false;
                cbPLeftDownCamera.Enabled = false;
                cbPRightDownCamera.Enabled = false;
                //像素比列
                tbNLeftUpCamreraPixelRatio.Enabled = true;
                tbNRightUpCamreraPixelRatio.Enabled = true;
                tbNLeftDownCamreraPixelRatio.Enabled = true;
                tbNRightDownCamreraPixelRatio.Enabled = PublicSet.Myset.DetectMode == "3相机正负单测" ? false : true;
                tbPLeftUpCamreraPixelRatio.Enabled = false;
                tbPRightUpCamreraPixelRatio.Enabled = false;
                tbPLeftDownCamreraPixelRatio.Enabled = false;
                tbPRightDownCamreraPixelRatio.Enabled = false;
                //自定义命名
                tbNLeftUpCamreraName.Enabled = true;
                tbNRightUpCamreraName.Enabled = true;
                tbNLeftDownCamreraName.Enabled = true;
                tbNRightDownCamreraName.Enabled = PublicSet.Myset.DetectMode == "3相机正负单测" ? false : true;
                tbPLeftUpCamreraName.Enabled = false;
                tbPRightUpCamreraName.Enabled = false;
                tbPLeftDownCamreraName.Enabled = false;
                tbPRightDownCamreraName.Enabled = false;
            }
            if ((PublicSet.Myset.DetectMode == "3相机正负单测" || PublicSet.Myset.DetectMode == "4相机正负单测") && PublicSet.Myset.PositiveSwitch)
            {
                //相机标识
                cbNLeftUpCamera.Enabled = false;
                cbNRightUpCamera.Enabled = false;
                cbNLeftDownCamera.Enabled = false;
                cbNRightDownCamera.Enabled = false;
                cbPLeftUpCamera.Enabled = true;
                cbPRightUpCamera.Enabled = true;
                cbPLeftDownCamera.Enabled = true;
                cbPRightDownCamera.Enabled = PublicSet.Myset.DetectMode == "3相机正负单测" ? false : true;
                //像素比列
                tbNLeftUpCamreraPixelRatio.Enabled = false;
                tbNRightUpCamreraPixelRatio.Enabled = false;
                tbNLeftDownCamreraPixelRatio.Enabled = false;
                tbNRightDownCamreraPixelRatio.Enabled = false;
                tbPLeftUpCamreraPixelRatio.Enabled = true;
                tbPRightUpCamreraPixelRatio.Enabled = true;
                tbPLeftDownCamreraPixelRatio.Enabled = true;
                tbPRightDownCamreraPixelRatio.Enabled = PublicSet.Myset.DetectMode == "3相机正负单测" ? false : true;
                //自定义命名
                tbNLeftUpCamreraName.Enabled = false;
                tbNLeftUpCamreraName.Enabled = false;
                tbNRightUpCamreraName.Enabled = false;
                tbNLeftDownCamreraName.Enabled = false;
                tbNRightDownCamreraName.Enabled = false;
                tbPLeftUpCamreraName.Enabled = true;
                tbPRightUpCamreraName.Enabled = true;
                tbPLeftDownCamreraName.Enabled = true;
                tbPRightDownCamreraName.Enabled = PublicSet.Myset.DetectMode == "3相机正负单测" ? false : true;
            }


        }
        /// <summary>
        /// 通讯设置ui
        /// </summary>
        public void CommunicateSetUI()
        {
            switch (PublicSet.Myset.StrPlcTcp)
            {
                case "CIP": RadioCIP.Checked = true; break;
                case "Fins": RadioFins.Checked = true; break;
                case "AB": RadioAB.Checked = true; break;
                case "CK": RadioCK.Checked = true; break;
                case "TCP": RadioTCP.Checked = true; break;
                case "EIP": RadioEIP.Checked = true; break;
                case "内存共享": RadioNCGX.Checked = true; break;
                default: RadioMB.Checked = true; break;
            }
            tbIP.Text = PublicSet.Myset.IP;
            tbComputerIP.Text = PublicSet.Myset.ComputerIP;
            tbDClient.Text = PublicSet.Myset.DClient;
            tbClient.Text = PublicSet.Myset.Client;
            tbTriggerPhotographAddrees.Text = PublicSet.Myset.TriggerPhotographAddrees;
            tbNGisok.Text = PublicSet.Myset.NGisok;

            tbOKNGAddress.Text = PublicSet.Myset.OKNGAddress;
            tbHeartbeatAddress.Text = PublicSet.Myset.HeartbeatAddress;
            tbNGcountAddress.Text = PublicSet.Myset.NGcountAddress;
            tbCraftAddress.Text = PublicSet.Myset.CraftAddress;
            tbReadCraftAddress.Text = PublicSet.Myset.ReadCraftAddress;

            tbPoleReelN.Text = PublicSet.Myset.PoleReelN;
            tbPoleReelP.Text = PublicSet.Myset.PoleReelP;

            tbChangeOfLapAddressN.Text = PublicSet.Myset.ChangeOfLapAddressN;
            tbChangeOfLapAddressP.Text = PublicSet.Myset.ChangeOfLapAddressP;

            tbRollingDiameterAddressN.Text = PublicSet.Myset.RollingDiameterAddressN;
            tbRollingDiameterAddressP.Text = PublicSet.Myset.RollingDiameterAddressP;

            tbLoginVerifyN.Text = PublicSet.Myset.LoginVerifyN;
            tbLoginVerifyP.Text = PublicSet.Myset.LoginVerifyP;
            tbLoginUserName.Text = PublicSet.Myset.LoginUserName;
            tbLoginUserPower.Text = PublicSet.Myset.LoginUserPower;
        }
        /// <summary>
        /// 负极工艺设置ui
        /// </summary>
        public void NCraftSetUI()
        {
            //极片头宽
            cbNJPHeadWidthSwitch.Checked = PublicSet.Myset.NJPHeadWidthSwitch;
            tbNJPHeadWidthStandard.Text = PublicSet.Myset.NJPHeadWidthStandard.ToString();
            tbNJPHeadWidthMax.Text = PublicSet.Myset.NJPHeadWidthMax.ToString();
            tbNJPHeadWidthMin.Text = PublicSet.Myset.NJPHeadWidthMin.ToString();
            tbNJPHeadWidthName.Text = PublicSet.Myset.NJPHeadWidthName;
            tbNJPHeadWidthCompensate.Text = PublicSet.Cameraset.NJPHeadWidthCompensate.ToString();
            //极片尾宽
            cbNJPTailWidthSwitch.Checked = PublicSet.Myset.NJPTailWidthSwitch;
            tbNJPTailWidthStandard.Text = PublicSet.Myset.NJPTailWidthStandard.ToString();
            tbNJPTailWidthMax.Text = PublicSet.Myset.NJPTailWidthMax.ToString();
            tbNJPTailWidthMin.Text = PublicSet.Myset.NJPTailWidthMin.ToString();
            tbNJPTailWidthName.Text = PublicSet.Myset.NJPTailWidthName;
            tbNJPTailWidthCompensate.Text = PublicSet.Cameraset.NJPTailWidthCompensate.ToString();
            //极片头长
            cbNJPHeadLengthSwitch.Checked = PublicSet.Myset.NJPHeadLengthSwitch;
            tbNJPHeadLengthStandard.Text = PublicSet.Myset.NJPHeadLengthStandard.ToString();
            tbNJPHeadLengthMax.Text = PublicSet.Myset.NJPHeadLengthMax.ToString();
            tbNJPHeadLengthMin.Text = PublicSet.Myset.NJPHeadLengthMin.ToString();
            tbNJPHeadLengthName.Text = PublicSet.Myset.NJPHeadLengthName;
            tbNJPHeadLengthCompensate.Text = PublicSet.Cameraset.NJPHeadLengthCompensate.ToString();
            //极片尾长
            cbNJPTailLengthSwitch.Checked = PublicSet.Myset.NJPTailLengthSwitch;
            tbNJPTailLengthStandard.Text = PublicSet.Myset.NJPTailLengthStandard.ToString();
            tbNJPTailLengthMax.Text = PublicSet.Myset.NJPTailLengthMax.ToString();
            tbNJPTailLengthMin.Text = PublicSet.Myset.NJPTailLengthMin.ToString();
            tbNJPTailLengthName.Text = PublicSet.Myset.NJPTailLengthName;
            tbNJPTailLengthCompensate.Text = PublicSet.Cameraset.NJPTailLengthCompensate.ToString();
            //左肩宽
            cbNJELeftShoulderSwitch.Checked = PublicSet.Myset.NJELeftShoulderSwitch;
            tbNJELeftShoulderStandard.Text = PublicSet.Myset.NJELeftShoulderStandard.ToString();
            tbNJELeftShoulderMax.Text = PublicSet.Myset.NJELeftShoulderMax.ToString();
            tbNJELeftShoulderMin.Text = PublicSet.Myset.NJELeftShoulderMin.ToString();
            tbNJELeftShoulderName.Text = PublicSet.Myset.NJELeftShoulderName;
            tbNJELeftShoulderCompensate.Text = PublicSet.Cameraset.NJELeftShoulderCompensate.ToString();
            //右肩宽
            cbNJERightShoulderSwitch.Checked = PublicSet.Myset.NJERightShoulderSwitch;
            tbNJERightShoulderStandard.Text = PublicSet.Myset.NJERightShoulderStandard.ToString();
            tbNJERightShoulderMax.Text = PublicSet.Myset.NJERightShoulderMax.ToString();
            tbNJERightShoulderMin.Text = PublicSet.Myset.NJERightShoulderMin.ToString();
            tbNJERightShoulderName.Text = PublicSet.Myset.NJERightShoulderName;
            tbNJERightShoulderCompensate.Text = PublicSet.Cameraset.NJERightShoulderCompensate.ToString();
            //极耳宽
            cbNJEWidthSwitch.Checked = PublicSet.Myset.NJEWidthSwitch;
            tbNJEWidthStandard.Text = PublicSet.Myset.NJEWidthStandard.ToString();
            tbNJEWidthMax.Text = PublicSet.Myset.NJEWidthMax.ToString();
            tbNJEWidthMin.Text = PublicSet.Myset.NJEWidthMin.ToString();
            tbNJEWidthName.Text = PublicSet.Myset.NJEWidthName;
            tbNJEWidthCompensate.Text = PublicSet.Cameraset.NJEWidthCompensate.ToString();
            //极耳高
            cbNJEHeightSwitch.Checked = PublicSet.Myset.NJEHeightSwitch;
            tbNJEHeightStandard.Text = PublicSet.Myset.NJEHeightStandard.ToString();
            tbNJEHeightMax.Text = PublicSet.Myset.NJEHeightMax.ToString();
            tbNJEHeightMin.Text = PublicSet.Myset.NJEHeightMin.ToString();
            tbNJEHeightName.Text = PublicSet.Myset.NJEHeightName;
            tbNJEHeightCompensate.Text = PublicSet.Cameraset.NJEHeightCompensate.ToString();
            //带料高
            cbNDLHeightSwitch.Checked = PublicSet.Myset.NDLHeightSwitch;
            tbNDLHeightStandard.Text = PublicSet.Myset.NDLHeightStandard.ToString();
            tbNDLHeightMax.Text = PublicSet.Myset.NDLHeightMax.ToString();
            tbNDLHeightMin.Text = PublicSet.Myset.NDLHeightMin.ToString();
            tbNDLHeightName.Text = PublicSet.Myset.NDLHeightName;
            tbNDLHeightCompensate.Text = PublicSet.Cameraset.NDLHeightCompensate.ToString();
            //总宽
            cbNJPTotalWidthSwitch.Checked = PublicSet.Myset.NJPTotalWidthSwitch;
            tbNJPTotalWidthStandard.Text = PublicSet.Myset.NJPTotalWidthStandard.ToString();
            tbNJPTotalWidthMax.Text = PublicSet.Myset.NJPTotalWidthMax.ToString();
            tbNJPTotalWidthMin.Text = PublicSet.Myset.NJPTotalWidthMin.ToString();
            tbNJPTotalWidthName.Text = PublicSet.Myset.NJPTotalWidthName;
            tbNJPTotalWidthCompensate.Text = PublicSet.Cameraset.NJPTotalWidthCompensate.ToString();
            //涂布高
            cbNJPCoatingSwitch.Checked = PublicSet.Myset.NJPCoatingSwitch;
            tbNJPCoatingStandard.Text = PublicSet.Myset.NJPCoatingStandard.ToString();
            tbNJPCoatingMax.Text = PublicSet.Myset.NJPCoatingMax.ToString();
            tbNJPCoatingMin.Text = PublicSet.Myset.NJPCoatingMin.ToString();
            tbNJPCoatingName.Text = PublicSet.Myset.NJPCoatingName;
            tbNJPCoatingCompensate.Text = PublicSet.Cameraset.NJPCoatingCompensate.ToString();
            //对角线
            cbNDiagonalSwitch.Checked = PublicSet.Myset.NDiagonalSwitch;
            tbNDiagonalStandard.Text = PublicSet.Myset.NDiagonalStandard.ToString();
            tbNDiagonalMax.Text = PublicSet.Myset.NDiagonalMax.ToString();
            tbNDiagonalMin.Text = PublicSet.Myset.NDiagonalMin.ToString();
            tbNDiagonalName.Text = PublicSet.Myset.NDiagonalName;
            tbNDiagonalCompensate.Text = PublicSet.Cameraset.NDiagonalCompensate.ToString();
            //左上垂直角度
            cbNLeftUpAngleSwitch.Checked = PublicSet.Myset.NLeftUpAngleSwitch;
            tbNLeftUpAngleStandard.Text = PublicSet.Myset.NLeftUpAngleStandard.ToString();
            tbNLeftUpAngleMax.Text = PublicSet.Myset.NLeftUpAngleMax.ToString();
            tbNLeftUpAngleMin.Text = PublicSet.Myset.NLeftUpAngleMin.ToString();
            tbNLeftUpAngleName.Text = PublicSet.Myset.NLeftUpAngleName;
            tbNLeftUpAngleCompensate.Text = PublicSet.Cameraset.NLeftUpAngleCompensate.ToString();
            //右上垂直角度
            cbNRightUpAngleSwitch.Checked = PublicSet.Myset.NRightUpAngleSwitch;
            tbNRightUpAngleStandard.Text = PublicSet.Myset.NRightUpAngleStandard.ToString();
            tbNRightUpAngleMax.Text = PublicSet.Myset.NRightUpAngleMax.ToString();
            tbNRightUpAngleMin.Text = PublicSet.Myset.NRightUpAngleMin.ToString();
            tbNRightUpAngleName.Text = PublicSet.Myset.NRightUpAngleName;
            tbNRightUpAngleCompensate.Text = PublicSet.Cameraset.NRightUpAngleCompensate.ToString();
            //左下垂直角度
            cbNLeftDownAngleSwitch.Checked = PublicSet.Myset.NLeftDownAngleSwitch;
            tbNLeftDownAngleStandard.Text = PublicSet.Myset.NLeftDownAngleStandard.ToString();
            tbNLeftDownAngleMax.Text = PublicSet.Myset.NLeftDownAngleMax.ToString();
            tbNLeftDownAngleMin.Text = PublicSet.Myset.NLeftDownAngleMin.ToString();
            tbNLeftDownAngleName.Text = PublicSet.Myset.NLeftDownAngleName;
            tbNLeftDownAngleCompensate.Text = PublicSet.Cameraset.NLeftDownAngleCompensate.ToString();
            //右下垂直角度
            cbNRightDownAngleSwitch.Checked = PublicSet.Myset.NRightDownAngleSwitch;
            tbNRightDownAngleStandard.Text = PublicSet.Myset.NRightDownAngleStandard.ToString();
            tbNRightDownAngleMax.Text = PublicSet.Myset.NRightDownAngleMax.ToString();
            tbNRightDownAngleMin.Text = PublicSet.Myset.NRightDownAngleMin.ToString();
            tbNRightDownAngleName.Text = PublicSet.Myset.NRightDownAngleName;
            tbNRightDownAngleCompensate.Text = PublicSet.Cameraset.NRightDownAngleCompensate.ToString();
            //mark点
            cbNMarkSwitch.Checked = PublicSet.Myset.NMarkSwitch;
            tbNMarkMin.Text = PublicSet.Myset.NMarkMin.ToString();
            tbNMarkMax.Text = PublicSet.Myset.NMarkMax.ToString();
            //mark点
            cbPMarkSwitch.Checked = PublicSet.Myset.PMarkSwitch;
            tbPMarkMin.Text = PublicSet.Myset.PMarkMin.ToString();
            tbPMarkMax.Text = PublicSet.Myset.PMarkMax.ToString();
        }
        /// <summary>
        /// 正极工艺设置ui
        /// </summary>
        public void PCraftSetUI()
        {
            //极片头宽
            cbPJPHeadWidthSwitch.Checked = PublicSet.Myset.PJPHeadWidthSwitch;
            tbPJPHeadWidthStandard.Text = PublicSet.Myset.PJPHeadWidthStandard.ToString();
            tbPJPHeadWidthMax.Text = PublicSet.Myset.PJPHeadWidthMax.ToString();
            tbPJPHeadWidthMin.Text = PublicSet.Myset.PJPHeadWidthMin.ToString();
            tbPJPHeadWidthName.Text = PublicSet.Myset.PJPHeadWidthName;
            tbPJPHeadWidthCompensate.Text = PublicSet.Cameraset.PJPHeadWidthCompensate.ToString();
            //极片尾宽
            cbPJPTailWidthSwitch.Checked = PublicSet.Myset.PJPTailWidthSwitch;
            tbPJPTailWidthStandard.Text = PublicSet.Myset.PJPTailWidthStandard.ToString();
            tbPJPTailWidthMax.Text = PublicSet.Myset.PJPTailWidthMax.ToString();
            tbPJPTailWidthMin.Text = PublicSet.Myset.PJPTailWidthMin.ToString();
            tbPJPTailWidthName.Text = PublicSet.Myset.PJPTailWidthName;
            tbPJPTailWidthCompensate.Text = PublicSet.Cameraset.PJPTailWidthCompensate.ToString();
            //极片头长
            cbPJPHeadLengthSwitch.Checked = PublicSet.Myset.PJPHeadLengthSwitch;
            tbPJPHeadLengthStandard.Text = PublicSet.Myset.PJPHeadLengthStandard.ToString();
            tbPJPHeadLengthMax.Text = PublicSet.Myset.PJPHeadLengthMax.ToString();
            tbPJPHeadLengthMin.Text = PublicSet.Myset.PJPHeadLengthMin.ToString();
            tbPJPHeadLengthName.Text = PublicSet.Myset.PJPHeadLengthName;
            tbPJPHeadLengthCompensate.Text = PublicSet.Cameraset.PJPHeadLengthCompensate.ToString();
            //极片尾长
            cbPJPTailLengthSwitch.Checked = PublicSet.Myset.PJPTailLengthSwitch;
            tbPJPTailLengthStandard.Text = PublicSet.Myset.PJPTailLengthStandard.ToString();
            tbPJPTailLengthMax.Text = PublicSet.Myset.PJPTailLengthMax.ToString();
            tbPJPTailLengthMin.Text = PublicSet.Myset.PJPTailLengthMin.ToString();
            tbPJPTailLengthName.Text = PublicSet.Myset.PJPTailLengthName;
            tbPJPTailLengthCompensate.Text = PublicSet.Cameraset.PJPTailLengthCompensate.ToString();
            //左肩宽
            cbPJELeftShoulderSwitch.Checked = PublicSet.Myset.PJELeftShoulderSwitch;
            tbPJELeftShoulderStandard.Text = PublicSet.Myset.PJELeftShoulderStandard.ToString();
            tbPJELeftShoulderMax.Text = PublicSet.Myset.PJELeftShoulderMax.ToString();
            tbPJELeftShoulderMin.Text = PublicSet.Myset.PJELeftShoulderMin.ToString();
            tbPJELeftShoulderName.Text = PublicSet.Myset.PJELeftShoulderName;
            tbPJELeftShoulderCompensate.Text = PublicSet.Cameraset.PJELeftShoulderCompensate.ToString();
            //右肩宽
            cbPJERightShoulderSwitch.Checked = PublicSet.Myset.PJERightShoulderSwitch;
            tbPJERightShoulderStandard.Text = PublicSet.Myset.PJERightShoulderStandard.ToString();
            tbPJERightShoulderMax.Text = PublicSet.Myset.PJERightShoulderMax.ToString();
            tbPJERightShoulderMin.Text = PublicSet.Myset.PJERightShoulderMin.ToString();
            tbPJERightShoulderName.Text = PublicSet.Myset.PJERightShoulderName;
            tbPJERightShoulderCompensate.Text = PublicSet.Cameraset.PJERightShoulderCompensate.ToString();
            //极耳宽
            cbPJEWidthSwitch.Checked = PublicSet.Myset.PJEWidthSwitch;
            tbPJEWidthStandard.Text = PublicSet.Myset.PJEWidthStandard.ToString();
            tbPJEWidthMax.Text = PublicSet.Myset.PJEWidthMax.ToString();
            tbPJEWidthMin.Text = PublicSet.Myset.PJEWidthMin.ToString();
            tbPJEWidthName.Text = PublicSet.Myset.PJEWidthName;
            tbPJEWidthCompensate.Text = PublicSet.Cameraset.PJEWidthCompensate.ToString();
            //极耳高
            cbPJEHeightSwitch.Checked = PublicSet.Myset.PJEHeightSwitch;
            tbPJEHeightStandard.Text = PublicSet.Myset.PJEHeightStandard.ToString();
            tbPJEHeightMax.Text = PublicSet.Myset.PJEHeightMax.ToString();
            tbPJEHeightMin.Text = PublicSet.Myset.PJEHeightMin.ToString();
            tbPJEHeightName.Text = PublicSet.Myset.PJEHeightName;
            tbPJEHeightCompensate.Text = PublicSet.Cameraset.PJEHeightCompensate.ToString();
            //陶瓷高
            cbPCeramicHeightSwitch.Checked = PublicSet.Myset.PCeramicHeightSwitch;
            tbPCeramicHeightStandard.Text = PublicSet.Myset.PCeramicHeightStandard.ToString();
            tbPCeramicHeightMax.Text = PublicSet.Myset.PCeramicHeightMax.ToString();
            tbPCeramicHeightMin.Text = PublicSet.Myset.PCeramicHeightMin.ToString();
            tbPCeramicHeightName.Text = PublicSet.Myset.PCeramicHeightName;
            tbPCeramicHeightCompensate.Text = PublicSet.Cameraset.PCeramicHeightCompensate.ToString();
            //总宽
            cbPJPTotalWidthSwitch.Checked = PublicSet.Myset.PJPTotalWidthSwitch;
            tbPJPTotalWidthStandard.Text = PublicSet.Myset.PJPTotalWidthStandard.ToString();
            tbPJPTotalWidthMax.Text = PublicSet.Myset.PJPTotalWidthMax.ToString();
            tbPJPTotalWidthMin.Text = PublicSet.Myset.PJPTotalWidthMin.ToString();
            tbPJPTotalWidthName.Text = PublicSet.Myset.PJPTotalWidthName;
            tbPJPTotalWidthCompensate.Text = PublicSet.Cameraset.PJPTotalWidthCompensate.ToString();
            //涂布高
            cbPJPCoatingSwitch.Checked = PublicSet.Myset.PJPCoatingSwitch;
            tbPJPCoatingStandard.Text = PublicSet.Myset.PJPCoatingStandard.ToString();
            tbPJPCoatingMax.Text = PublicSet.Myset.PJPCoatingMax.ToString();
            tbPJPCoatingMin.Text = PublicSet.Myset.PJPCoatingMin.ToString();
            tbPJPCoatingName.Text = PublicSet.Myset.PJPCoatingName;
            tbPJPCoatingCompensate.Text = PublicSet.Cameraset.PJPCoatingCompensate.ToString();
            //对角线
            cbPDiagonalSwitch.Checked = PublicSet.Myset.PDiagonalSwitch;
            tbPDiagonalStandard.Text = PublicSet.Myset.PDiagonalStandard.ToString();
            tbPDiagonalMax.Text = PublicSet.Myset.PDiagonalMax.ToString();
            tbPDiagonalMin.Text = PublicSet.Myset.PDiagonalMin.ToString();
            tbPDiagonalName.Text = PublicSet.Myset.PDiagonalName;
            tbPDiagonalCompensate.Text = PublicSet.Cameraset.PDiagonalCompensate.ToString();
            //左上垂直角度
            cbPLeftUpAngleSwitch.Checked = PublicSet.Myset.PLeftUpAngleSwitch;
            tbPLeftUpAngleStandard.Text = PublicSet.Myset.PLeftUpAngleStandard.ToString();
            tbPLeftUpAngleMax.Text = PublicSet.Myset.PLeftUpAngleMax.ToString();
            tbPLeftUpAngleMin.Text = PublicSet.Myset.PLeftUpAngleMin.ToString();
            tbPLeftUpAngleName.Text = PublicSet.Myset.PLeftUpAngleName;
            tbPLeftUpAngleCompensate.Text = PublicSet.Cameraset.PLeftUpAngleCompensate.ToString();
            //右上垂直角度
            cbPRightUpAngleSwitch.Checked = PublicSet.Myset.PRightUpAngleSwitch;
            tbPRightUpAngleStandard.Text = PublicSet.Myset.PRightUpAngleStandard.ToString();
            tbPRightUpAngleMax.Text = PublicSet.Myset.PRightUpAngleMax.ToString();
            tbPRightUpAngleMin.Text = PublicSet.Myset.PRightUpAngleMin.ToString();
            tbPRightUpAngleName.Text = PublicSet.Myset.PRightUpAngleName;
            tbPRightUpAngleCompensate.Text = PublicSet.Cameraset.PRightUpAngleCompensate.ToString();
            //左下垂直角度
            cbPLeftDownAngleSwitch.Checked = PublicSet.Myset.PLeftDownAngleSwitch;
            tbPLeftDownAngleStandard.Text = PublicSet.Myset.PLeftDownAngleStandard.ToString();
            tbPLeftDownAngleMax.Text = PublicSet.Myset.PLeftDownAngleMax.ToString();
            tbPLeftDownAngleMin.Text = PublicSet.Myset.PLeftDownAngleMin.ToString();
            tbPLeftDownAngleName.Text = PublicSet.Myset.PLeftDownAngleName;
            tbPLeftDownAngleCompensate.Text = PublicSet.Cameraset.PLeftDownAngleCompensate.ToString();
            //右下垂直角度
            cbPRightDownAngleSwitch.Checked = PublicSet.Myset.PRightDownAngleSwitch;
            tbPRightDownAngleStandard.Text = PublicSet.Myset.PRightDownAngleStandard.ToString();
            tbPRightDownAngleMax.Text = PublicSet.Myset.PRightDownAngleMax.ToString();
            tbPRightDownAngleMin.Text = PublicSet.Myset.PRightDownAngleMin.ToString();
            tbPRightDownAngleName.Text = PublicSet.Myset.PRightDownAngleName;
            tbPRightDownAngleCompensate.Text = PublicSet.Cameraset.PRightDownAngleCompensate.ToString();

        }
        /// <summary>
        /// 负极V角工艺设置ui
        /// </summary>
        public void NVCraftSetUI()
        {
            gbNArc.Visible = cbNOpenArcSwitch.Checked = PublicSet.Myset.NOpenArcSwitch;
            tbNLeftUpArcjdGray.Text = PublicSet.Myset.NLeftUpArcjdGray.ToString();
            tbNRightUpArcjdGray.Text = PublicSet.Myset.NRightUpArcjdGray.ToString();
            tbNLeftDownArcjdGray.Text = PublicSet.Myset.NLeftDownArcjdGray.ToString();
            tbNRightDownArcjdGray.Text = PublicSet.Myset.NRightDownArcjdGray.ToString();

            tbNLeftUpArcRad.Text = PublicSet.Myset.NLeftUpArcRad.ToString();
            tbNRightUpArcRad.Text = PublicSet.Myset.NRightUpArcRad.ToString();
            tbNLeftDownArcRad.Text = PublicSet.Myset.NLeftDownArcRad.ToString();
            tbNRightDownArcRad.Text = PublicSet.Myset.NRightDownArcRad.ToString();

            tbNLeftUpArcjdDit.Text = PublicSet.Myset.NLeftUpArcjdDit.ToString();
            tbNRightUpArcjdDit.Text = PublicSet.Myset.NRightUpArcjdDit.ToString();
            tbNLeftDownArcjdDit.Text = PublicSet.Myset.NLeftDownArcjdDit.ToString();
            tbNRightDownArcjdDit.Text = PublicSet.Myset.NRightDownArcjdDit.ToString();

            //左上
            cbNLeftUpVAngleSwitch.Checked = PublicSet.Myset.NLeftUpVAngleSwitch;
            tbNLeftUpVAngleMin.Text = PublicSet.Myset.NLeftUpVAngleMin.ToString();
            tbNLeftUpVAngleMax.Text = PublicSet.Myset.NLeftUpVAngleMax.ToString();
            tbNLeftUpVAngleStandard.Text = PublicSet.Myset.NLeftUpVAngleStandard.ToString();
            tbNLeftUpVAngleName.Text = PublicSet.Myset.NLeftUpVAngleName;
            tbNLeftUpVAngleCompensate.Text = PublicSet.Cameraset.NLeftUpVAngleCompensate.ToString();

            cbNLeftUpVWidthSwitch.Checked = PublicSet.Myset.NLeftUpVWidthSwitch;
            tbNLeftUpVWidthMin.Text = PublicSet.Myset.NLeftUpVWidthMin.ToString();
            tbNLeftUpVWidthMax.Text = PublicSet.Myset.NLeftUpVWidthMax.ToString();
            tbNLeftUpVWidthStandard.Text = PublicSet.Myset.NLeftUpVWidthStandard.ToString();
            tbNLeftUpVWidthName.Text = PublicSet.Myset.NLeftUpVWidthName;
            tbNLeftUpVWidthCompensate.Text = PublicSet.Cameraset.NLeftUpVWidthCompensate.ToString();

            cbNLeftUpVDepthSwitch.Checked = PublicSet.Myset.NLeftUpVDepthSwitch;
            tbNLeftUpVDepthMin.Text = PublicSet.Myset.NLeftUpVDepthMin.ToString();
            tbNLeftUpVDepthMax.Text = PublicSet.Myset.NLeftUpVDepthMax.ToString();
            tbNLeftUpVDepthStandard.Text = PublicSet.Myset.NLeftUpVDepthStandard.ToString();
            tbNLeftUpVDepthName.Text = PublicSet.Myset.NLeftUpVDepthName;
            tbNLeftUpVDepthCompensate.Text = PublicSet.Cameraset.NLeftUpVDepthCompensate.ToString();

            //右上
            cbNRightUpVAngleSwitch.Checked = PublicSet.Myset.NRightUpVAngleSwitch;
            tbNRightUpVAngleMin.Text = PublicSet.Myset.NRightUpVAngleMin.ToString();
            tbNRightUpVAngleMax.Text = PublicSet.Myset.NRightUpVAngleMax.ToString();
            tbNRightUpVAngleStandard.Text = PublicSet.Myset.NRightUpVAngleStandard.ToString();
            tbNRightUpVAngleName.Text = PublicSet.Myset.NRightUpVAngleName;
            tbNRightUpVAngleCompensate.Text = PublicSet.Cameraset.NRightUpVAngleCompensate.ToString();

            cbNRightUpVWidthSwitch.Checked = PublicSet.Myset.NRightUpVWidthSwitch;
            tbNRightUpVWidthMin.Text = PublicSet.Myset.NRightUpVWidthMin.ToString();
            tbNRightUpVWidthMax.Text = PublicSet.Myset.NRightUpVWidthMax.ToString();
            tbNRightUpVWidthStandard.Text = PublicSet.Myset.NRightUpVWidthStandard.ToString();
            tbNRightUpVWidthName.Text = PublicSet.Myset.NRightUpVWidthName;
            tbNRightUpVWidthCompensate.Text = PublicSet.Cameraset.NRightUpVWidthCompensate.ToString();

            cbNRightUpVDepthSwitch.Checked = PublicSet.Myset.NRightUpVDepthSwitch;
            tbNRightUpVDepthMin.Text = PublicSet.Myset.NRightUpVDepthMin.ToString();
            tbNRightUpVDepthMax.Text = PublicSet.Myset.NRightUpVDepthMax.ToString();
            tbNRightUpVDepthStandard.Text = PublicSet.Myset.NRightUpVDepthStandard.ToString();
            tbNRightUpVDepthName.Text = PublicSet.Myset.NRightUpVDepthName;
            tbNRightUpVDepthCompensate.Text = PublicSet.Cameraset.NRightUpVDepthCompensate.ToString();

            //左下
            cbNLeftDownVAngleSwitch.Checked = PublicSet.Myset.NLeftDownVAngleSwitch;
            tbNLeftDownVAngleMin.Text = PublicSet.Myset.NLeftDownVAngleMin.ToString();
            tbNLeftDownVAngleMax.Text = PublicSet.Myset.NLeftDownVAngleMax.ToString();
            tbNLeftDownVAngleStandard.Text = PublicSet.Myset.NLeftDownVAngleStandard.ToString();
            tbNLeftDownVAngleName.Text = PublicSet.Myset.NLeftDownVAngleName;
            tbNLeftDownVAngleCompensate.Text = PublicSet.Cameraset.NLeftDownVAngleCompensate.ToString();

            cbNLeftDownVWidthSwitch.Checked = PublicSet.Myset.NLeftDownVWidthSwitch;
            tbNLeftDownVWidthMin.Text = PublicSet.Myset.NLeftDownVWidthMin.ToString();
            tbNLeftDownVWidthMax.Text = PublicSet.Myset.NLeftDownVWidthMax.ToString();
            tbNLeftDownVWidthStandard.Text = PublicSet.Myset.NLeftDownVWidthStandard.ToString();
            tbNLeftDownVWidthName.Text = PublicSet.Myset.NLeftDownVWidthName;
            tbNLeftDownVWidthCompensate.Text = PublicSet.Cameraset.NLeftDownVWidthCompensate.ToString();

            cbNLeftDownVDepthSwitch.Checked = PublicSet.Myset.NLeftDownVDepthSwitch;
            tbNLeftDownVDepthMin.Text = PublicSet.Myset.NLeftDownVDepthMin.ToString();
            tbNLeftDownVDepthMax.Text = PublicSet.Myset.NLeftDownVDepthMax.ToString();
            tbNLeftDownVDepthStandard.Text = PublicSet.Myset.NLeftDownVDepthStandard.ToString();
            tbNLeftDownVDepthName.Text = PublicSet.Myset.NLeftDownVDepthName;
            tbNLeftDownVDepthCompensate.Text = PublicSet.Cameraset.NLeftDownVDepthCompensate.ToString();

            //右下
            cbNRightDownVAngleSwitch.Checked = PublicSet.Myset.NRightDownVAngleSwitch;
            tbNRightDownVAngleMin.Text = PublicSet.Myset.NRightDownVAngleMin.ToString();
            tbNRightDownVAngleMax.Text = PublicSet.Myset.NRightDownVAngleMax.ToString();
            tbNRightDownVAngleStandard.Text = PublicSet.Myset.NRightDownVAngleStandard.ToString();
            tbNRightDownVAngleName.Text = PublicSet.Myset.NRightDownVAngleName;
            tbNRightDownVAngleCompensate.Text = PublicSet.Cameraset.NRightDownVAngleCompensate.ToString();

            cbNRightDownVWidthSwitch.Checked = PublicSet.Myset.NRightDownVWidthSwitch;
            tbNRightDownVWidthMin.Text = PublicSet.Myset.NRightDownVWidthMin.ToString();
            tbNRightDownVWidthMax.Text = PublicSet.Myset.NRightDownVWidthMax.ToString();
            tbNRightDownVWidthStandard.Text = PublicSet.Myset.NRightDownVWidthStandard.ToString();
            tbNRightDownVWidthName.Text = PublicSet.Myset.NRightDownVWidthName;
            tbNRightDownVWidthCompensate.Text = PublicSet.Cameraset.NRightDownVWidthCompensate.ToString();

            cbNRightDownVDepthSwitch.Checked = PublicSet.Myset.NRightDownVDepthSwitch;
            tbNRightDownVDepthMin.Text = PublicSet.Myset.NRightDownVDepthMin.ToString();
            tbNRightDownVDepthMax.Text = PublicSet.Myset.NRightDownVDepthMax.ToString();
            tbNRightDownVDepthStandard.Text = PublicSet.Myset.NRightDownVDepthStandard.ToString();
            tbNRightDownVDepthName.Text = PublicSet.Myset.NRightDownVDepthName;
            tbNRightDownVDepthCompensate.Text = PublicSet.Cameraset.NRightDownVDepthCompensate.ToString();
        }
        /// <summary>
        /// 正极V角工艺设置ui
        /// </summary>
        public void PVCraftSetUI()
        {
            gbPArc.Visible = cbPOpenArcSwitch.Checked = PublicSet.Myset.POpenArcSwitch;
            tbPLeftUpArcjdGray.Text = PublicSet.Myset.PLeftUpArcjdGray.ToString();
            tbPRightUpArcjdGray.Text = PublicSet.Myset.PRightUpArcjdGray.ToString();
            tbPLeftDownArcjdGray.Text = PublicSet.Myset.PLeftDownArcjdGray.ToString();
            tbPRightDownArcjdGray.Text = PublicSet.Myset.PRightDownArcjdGray.ToString();

            tbPLeftUpArcRad.Text = PublicSet.Myset.PLeftUpArcRad.ToString();
            tbPRightUpArcRad.Text = PublicSet.Myset.PRightUpArcRad.ToString();
            tbPLeftDownArcRad.Text = PublicSet.Myset.PLeftDownArcRad.ToString();
            tbPRightDownArcRad.Text = PublicSet.Myset.PRightDownArcRad.ToString();

            tbPLeftUpArcjdDit.Text = PublicSet.Myset.PLeftUpArcjdDit.ToString();
            tbPRightUpArcjdDit.Text = PublicSet.Myset.PRightUpArcjdDit.ToString();
            tbPLeftDownArcjdDit.Text = PublicSet.Myset.PLeftDownArcjdDit.ToString();
            tbPRightDownArcjdDit.Text = PublicSet.Myset.PRightDownArcjdDit.ToString();

            //左上
            cbPLeftUpVAngleSwitch.Checked = PublicSet.Myset.PLeftUpVAngleSwitch;
            tbPLeftUpVAngleMin.Text = PublicSet.Myset.PLeftUpVAngleMin.ToString();
            tbPLeftUpVAngleMax.Text = PublicSet.Myset.PLeftUpVAngleMax.ToString();
            tbPLeftUpVAngleStandard.Text = PublicSet.Myset.PLeftUpVAngleStandard.ToString();
            tbPLeftUpVAngleName.Text = PublicSet.Myset.PLeftUpVAngleName;
            tbPLeftUpVAngleCompensate.Text = PublicSet.Cameraset.PLeftUpVAngleCompensate.ToString();

            cbPLeftUpVWidthSwitch.Checked = PublicSet.Myset.PLeftUpVWidthSwitch;
            tbPLeftUpVWidthMin.Text = PublicSet.Myset.PLeftUpVWidthMin.ToString();
            tbPLeftUpVWidthMax.Text = PublicSet.Myset.PLeftUpVWidthMax.ToString();
            tbPLeftUpVWidthStandard.Text = PublicSet.Myset.PLeftUpVWidthStandard.ToString();
            tbPLeftUpVWidthName.Text = PublicSet.Myset.PLeftUpVWidthName;
            tbPLeftUpVWidthCompensate.Text = PublicSet.Cameraset.PLeftUpVWidthCompensate.ToString();

            cbPLeftUpVDepthSwitch.Checked = PublicSet.Myset.PLeftUpVDepthSwitch;
            tbPLeftUpVDepthMin.Text = PublicSet.Myset.PLeftUpVDepthMin.ToString();
            tbPLeftUpVDepthMax.Text = PublicSet.Myset.PLeftUpVDepthMax.ToString();
            tbPLeftUpVDepthStandard.Text = PublicSet.Myset.PLeftUpVDepthStandard.ToString();
            tbPLeftUpVDepthName.Text = PublicSet.Myset.PLeftUpVDepthName;
            tbPLeftUpVDepthCompensate.Text = PublicSet.Cameraset.PLeftUpVDepthCompensate.ToString();

            //右上
            cbPRightUpVAngleSwitch.Checked = PublicSet.Myset.PRightUpVAngleSwitch;
            tbPRightUpVAngleMin.Text = PublicSet.Myset.PRightUpVAngleMin.ToString();
            tbPRightUpVAngleMax.Text = PublicSet.Myset.PRightUpVAngleMax.ToString();
            tbPRightUpVAngleStandard.Text = PublicSet.Myset.PRightUpVAngleStandard.ToString();
            tbPRightUpVAngleName.Text = PublicSet.Myset.PRightUpVAngleName;
            tbPRightUpVAngleCompensate.Text = PublicSet.Cameraset.PRightUpVAngleCompensate.ToString();

            cbPRightUpVWidthSwitch.Checked = PublicSet.Myset.PRightUpVWidthSwitch;
            tbPRightUpVWidthMin.Text = PublicSet.Myset.PRightUpVWidthMin.ToString();
            tbPRightUpVWidthMax.Text = PublicSet.Myset.PRightUpVWidthMax.ToString();
            tbPRightUpVWidthStandard.Text = PublicSet.Myset.PRightUpVWidthStandard.ToString();
            tbPRightUpVWidthName.Text = PublicSet.Myset.PRightUpVWidthName;
            tbPRightUpVWidthCompensate.Text = PublicSet.Cameraset.PRightUpVWidthCompensate.ToString();

            cbPRightUpVDepthSwitch.Checked = PublicSet.Myset.PRightUpVDepthSwitch;
            tbPRightUpVDepthMin.Text = PublicSet.Myset.PRightUpVDepthMin.ToString();
            tbPRightUpVDepthMax.Text = PublicSet.Myset.PRightUpVDepthMax.ToString();
            tbPRightUpVDepthStandard.Text = PublicSet.Myset.PRightUpVDepthStandard.ToString();
            tbPRightUpVDepthName.Text = PublicSet.Myset.PRightUpVDepthName;
            tbPRightUpVDepthCompensate.Text = PublicSet.Cameraset.PRightUpVDepthCompensate.ToString();

            //左下
            cbPLeftDownVAngleSwitch.Checked = PublicSet.Myset.PLeftDownVAngleSwitch;
            tbPLeftDownVAngleMin.Text = PublicSet.Myset.PLeftDownVAngleMin.ToString();
            tbPLeftDownVAngleMax.Text = PublicSet.Myset.PLeftDownVAngleMax.ToString();
            tbPLeftDownVAngleStandard.Text = PublicSet.Myset.PLeftDownVAngleStandard.ToString();
            tbPLeftDownVAngleName.Text = PublicSet.Myset.PLeftDownVAngleName;
            tbPLeftDownVAngleCompensate.Text = PublicSet.Cameraset.PLeftDownVAngleCompensate.ToString();

            cbPLeftDownVWidthSwitch.Checked = PublicSet.Myset.PLeftDownVWidthSwitch;
            tbPLeftDownVWidthMin.Text = PublicSet.Myset.PLeftDownVWidthMin.ToString();
            tbPLeftDownVWidthMax.Text = PublicSet.Myset.PLeftDownVWidthMax.ToString();
            tbPLeftDownVWidthStandard.Text = PublicSet.Myset.PLeftDownVWidthStandard.ToString();
            tbPLeftDownVWidthName.Text = PublicSet.Myset.PLeftDownVWidthName;
            tbPLeftDownVWidthCompensate.Text = PublicSet.Cameraset.PLeftDownVWidthCompensate.ToString();

            cbPLeftDownVDepthSwitch.Checked = PublicSet.Myset.PLeftDownVDepthSwitch;
            tbPLeftDownVDepthMin.Text = PublicSet.Myset.PLeftDownVDepthMin.ToString();
            tbPLeftDownVDepthMax.Text = PublicSet.Myset.PLeftDownVDepthMax.ToString();
            tbPLeftDownVDepthStandard.Text = PublicSet.Myset.PLeftDownVDepthStandard.ToString();
            tbPLeftDownVDepthName.Text = PublicSet.Myset.PLeftDownVDepthName;
            tbPLeftDownVDepthCompensate.Text = PublicSet.Cameraset.PLeftDownVDepthCompensate.ToString();

            //右下
            cbPRightDownVAngleSwitch.Checked = PublicSet.Myset.PRightDownVAngleSwitch;
            tbPRightDownVAngleMin.Text = PublicSet.Myset.PRightDownVAngleMin.ToString();
            tbPRightDownVAngleMax.Text = PublicSet.Myset.PRightDownVAngleMax.ToString();
            tbPRightDownVAngleStandard.Text = PublicSet.Myset.PRightDownVAngleStandard.ToString();
            tbPRightDownVAngleName.Text = PublicSet.Myset.PRightDownVAngleName;
            tbPRightDownVAngleCompensate.Text = PublicSet.Cameraset.PRightDownVAngleCompensate.ToString();

            cbPRightDownVWidthSwitch.Checked = PublicSet.Myset.PRightDownVWidthSwitch;
            tbPRightDownVWidthMin.Text = PublicSet.Myset.PRightDownVWidthMin.ToString();
            tbPRightDownVWidthMax.Text = PublicSet.Myset.PRightDownVWidthMax.ToString();
            tbPRightDownVWidthStandard.Text = PublicSet.Myset.PRightDownVWidthStandard.ToString();
            tbPRightDownVWidthName.Text = PublicSet.Myset.PRightDownVWidthName;
            tbPRightDownVWidthCompensate.Text = PublicSet.Cameraset.PRightDownVWidthCompensate.ToString();

            cbPRightDownVDepthSwitch.Checked = PublicSet.Myset.PRightDownVDepthSwitch;
            tbPRightDownVDepthMin.Text = PublicSet.Myset.PRightDownVDepthMin.ToString();
            tbPRightDownVDepthMax.Text = PublicSet.Myset.PRightDownVDepthMax.ToString();
            tbPRightDownVDepthStandard.Text = PublicSet.Myset.PRightDownVDepthStandard.ToString();
            tbPRightDownVDepthName.Text = PublicSet.Myset.PRightDownVDepthName;
            tbPRightDownVDepthCompensate.Text = PublicSet.Cameraset.PRightDownVDepthCompensate.ToString();
        }
        /// <summary>
        /// 极耳打折设置ui
        /// </summary>
        public void BevelLimitSetUI()
        {
            //负极
            cbNJEBevelLimitSwitch.Checked = PublicSet.Myset.NJEBevelLimitSwitch;

            tbNJEGrayMin.Text = PublicSet.Myset.NJEGrayMin.ToString();
            tbNJEGrayMax.Text = PublicSet.Myset.NJEGrayMax.ToString();
            tbNJEAreaStandard.Text = PublicSet.Myset.NJEAreaStandard.ToString();
            tbNJEAreaRange.Text = PublicSet.Myset.NJEAreaRange.ToString();
            tbNJeOddmentsArea.Text = PublicSet.Myset.NJeOddmentsArea.ToString();
            tbNJEColumnErosion.Text = PublicSet.Myset.NJEColumnErosion.ToString();
            tbNJERowErosion.Text = PublicSet.Myset.NJERowErosion.ToString();
            tbNJERectangularity.Text = PublicSet.Myset.NJERectangularity.ToString();
            tbNJEGapGrayMin.Text = PublicSet.Myset.NJEGapGrayMin.ToString();
            tbNJEGapGrayMax.Text = PublicSet.Myset.NJEGapGrayMax.ToString();
            tbNJEGapAreaMax.Text = PublicSet.Myset.NJEGapAreaMax.ToString();
            tbNJEHeight.Text = PublicSet.Myset.NJEHeight.ToString();
            tbNJEWidth.Text = PublicSet.Myset.NJEWidth.ToString();
            tbNJEHeight1.Text = PublicSet.Myset.NJEHeight1.ToString();
            tbNJEWidth1.Text = PublicSet.Myset.NJEWidth1.ToString();
            tbNJEHeight1.Visible = tbNJEWidth1.Visible = PublicSet.Myset.JETwoCamera;

            tbNArcAreaMax_Up.Text = PublicSet.Myset.NArcAreaMax_Up.ToString();
            tbNArcAreaMax_Down.Text = PublicSet.Myset.NArcAreaMax_Down.ToString();
            tbNArcAreaMin_Down.Text = PublicSet.Myset.NArcAreaMin_Down.ToString();
            tbNArcGrayMin_Up.Text = PublicSet.Myset.NArcGrayMin_Up.ToString();
            //正极
            cbPJEBevelLimitSwitch.Checked = PublicSet.Myset.PJEBevelLimitSwitch;

            tbPJEGrayMin.Text = PublicSet.Myset.PJEGrayMin.ToString();
            tbPJEGrayMax.Text = PublicSet.Myset.PJEGrayMax.ToString();
            tbPJEAreaStandard.Text = PublicSet.Myset.PJEAreaStandard.ToString();
            tbPJEAreaRange.Text = PublicSet.Myset.PJEAreaRange.ToString();
            tbPJeOddmentsArea.Text = PublicSet.Myset.PJeOddmentsArea.ToString();
            tbPJEColumnErosion.Text = PublicSet.Myset.PJEColumnErosion.ToString();
            tbPJERowErosion.Text = PublicSet.Myset.PJERowErosion.ToString();
            tbPJERectangularity.Text = PublicSet.Myset.PJERectangularity.ToString();
            tbPJEGapGrayMin.Text = PublicSet.Myset.PJEGapGrayMin.ToString();
            tbPJEGapGrayMax.Text = PublicSet.Myset.PJEGapGrayMax.ToString();
            tbPJEGapAreaMax.Text = PublicSet.Myset.PJEGapAreaMax.ToString();
            tbPJEHeight.Text = PublicSet.Myset.PJEHeight.ToString();
            tbPJEWidth.Text = PublicSet.Myset.PJEWidth.ToString();
            tbPJEHeight1.Text = PublicSet.Myset.PJEHeight1.ToString();
            tbPJEWidth1.Text = PublicSet.Myset.PJEWidth1.ToString();
            tbPJEHeight1.Visible = tbPJEWidth1.Visible = PublicSet.Myset.JETwoCamera;

            tbPArcAreaMax_Up.Text = PublicSet.Myset.PArcAreaMax_Up.ToString();
            tbPArcAreaMax_Down.Text = PublicSet.Myset.PArcAreaMax_Down.ToString();
            tbPArcAreaMin_Down.Text = PublicSet.Myset.PArcAreaMin_Down.ToString();
            tbPArcGrayMin_Up.Text = PublicSet.Myset.PArcGrayMin_Up.ToString();
            if (PublicSet.Myset.DetectMode == "3相机正负单测" && PublicSet.Myset.NegativeSwitch)
            {
                groupBox15.Enabled = false;
            }
            if (PublicSet.Myset.DetectMode == "3相机正负单测" && PublicSet.Myset.PositiveSwitch)
            {
                groupBox22.Enabled = false;
            }

        }
        /// <summary>
        /// 极耳打折设置ui-极耳双相机时使用
        /// </summary>
        public void BevelLimitSetUI_Two()
        {
            //负极
            cbNJEBevelLimitSwitch1.Checked = PublicSet.Myset.NJEBevelLimitSwitch1;

            tbNJEGrayMin1.Text = PublicSet.Myset.NJEGrayMin1.ToString();
            tbNJEGrayMax1.Text = PublicSet.Myset.NJEGrayMax1.ToString();
            tbNJEAreaStandard1.Text = PublicSet.Myset.NJEAreaStandard1.ToString();
            tbNJEAreaRange1.Text = PublicSet.Myset.NJEAreaRange1.ToString();
            tbNJeOddmentsArea1.Text = PublicSet.Myset.NJeOddmentsArea1.ToString();
            tbNJEColumnErosion1.Text = PublicSet.Myset.NJEColumnErosion1.ToString();
            tbNJERowErosion1.Text = PublicSet.Myset.NJERowErosion1.ToString();
            tbNJERectangularity1.Text = PublicSet.Myset.NJERectangularity1.ToString();
            tbNJEGapGrayMin1.Text = PublicSet.Myset.NJEGapGrayMin1.ToString();
            tbNJEGapGrayMax1.Text = PublicSet.Myset.NJEGapGrayMax1.ToString();
            tbNJEGapAreaMax1.Text = PublicSet.Myset.NJEGapAreaMax1.ToString();

            tbNJEHeight1.Text = PublicSet.Myset.NJEHeight1.ToString();
            tbNJEWidth1.Text = PublicSet.Myset.NJEWidth1.ToString();
            tbNJEHeight1.Visible = tbNJEWidth1.Visible = PublicSet.Myset.JETwoCamera;

            tbNArcAreaMax_Up1.Text = PublicSet.Myset.NArcAreaMax_Up1.ToString();
            tbNArcAreaMax_Down1.Text = PublicSet.Myset.NArcAreaMax_Down1.ToString();
            tbNArcAreaMin_Down1.Text = PublicSet.Myset.NArcAreaMin_Down1.ToString();
            tbNArcGrayMin_Up1.Text = PublicSet.Myset.NArcGrayMin_Up1.ToString();
            //正极
            cbPJEBevelLimitSwitch1.Checked = PublicSet.Myset.PJEBevelLimitSwitch1;

            tbPJEGrayMin1.Text = PublicSet.Myset.PJEGrayMin1.ToString();
            tbPJEGrayMax1.Text = PublicSet.Myset.PJEGrayMax1.ToString();
            tbPJEAreaStandard1.Text = PublicSet.Myset.PJEAreaStandard1.ToString();
            tbPJEAreaRange1.Text = PublicSet.Myset.PJEAreaRange1.ToString();
            tbPJeOddmentsArea1.Text = PublicSet.Myset.PJeOddmentsArea1.ToString();
            tbPJEColumnErosion1.Text = PublicSet.Myset.PJEColumnErosion1.ToString();
            tbPJERowErosion1.Text = PublicSet.Myset.PJERowErosion1.ToString();
            tbPJERectangularity1.Text = PublicSet.Myset.PJERectangularity1.ToString();
            tbPJEGapGrayMin1.Text = PublicSet.Myset.PJEGapGrayMin1.ToString();
            tbPJEGapGrayMax1.Text = PublicSet.Myset.PJEGapGrayMax1.ToString();
            tbPJEGapAreaMax1.Text = PublicSet.Myset.PJEGapAreaMax1.ToString();

            tbPJEHeight1.Text = PublicSet.Myset.PJEHeight1.ToString();
            tbPJEWidth1.Text = PublicSet.Myset.PJEWidth1.ToString();
            tbPJEHeight1.Visible = tbPJEWidth1.Visible = PublicSet.Myset.JETwoCamera;

            tbPArcAreaMax_Up1.Text = PublicSet.Myset.PArcAreaMax_Up1.ToString();
            tbPArcAreaMax_Down1.Text = PublicSet.Myset.PArcAreaMax_Down1.ToString();
            tbPArcAreaMin_Down1.Text = PublicSet.Myset.PArcAreaMin_Down1.ToString();
            tbPArcGrayMin_Up1.Text = PublicSet.Myset.PArcGrayMin_Up1.ToString();
            if (PublicSet.Myset.DetectMode == "3相机正负单测" && PublicSet.Myset.NegativeSwitch)
            {
                groupBox15.Enabled = false;
            }
            if (PublicSet.Myset.DetectMode == "3相机正负单测" && PublicSet.Myset.PositiveSwitch)
            {
                groupBox22.Enabled = false;
            }

        }
        /// <summary>
        /// 缺角检测设置UI
        /// </summary>
        public void BevelSetUI()
        {
            //负极三角形 矩形开关
            cBNBevelTriangleSwitch.Checked = PublicSet.Myset.NBevelTriangleSwitch;
            //负左上
            cbNLeftUpBevelSwitch.Checked = PublicSet.Myset.NLeftUpBevelSwitch;
            tbNLeftUpBevelGrayMin.Text = PublicSet.Myset.NLeftUpBevelGrayMin.ToString();
            tbNLeftUpBevelAreaMin.Text = PublicSet.Myset.NLeftUpBevelAreaMin.ToString();
            tbNLeftUpBevelAreaMax.Text = PublicSet.Myset.NLeftUpBevelAreaMax.ToString();
            tbNLeftUpBevelFrame.Text = PublicSet.Myset.NLeftUpBevelFrame.ToString();
            tbNLeftUpBevelName.Text = PublicSet.Myset.NLeftUpBevelName;
            tbNLeftUpBevelCompensate.Text = PublicSet.Myset.NLeftUpBevelCompensate.ToString();
            //负右上
            cbNRightUpBevelSwitch.Checked = PublicSet.Myset.NRightUpBevelSwitch;
            tbNRightUpBevelGrayMin.Text = PublicSet.Myset.NRightUpBevelGrayMin.ToString();
            tbNRightUpBevelAreaMin.Text = PublicSet.Myset.NRightUpBevelAreaMin.ToString();
            tbNRightUpBevelAreaMax.Text = PublicSet.Myset.NRightUpBevelAreaMax.ToString();
            tbNRightUpBevelFrame.Text = PublicSet.Myset.NRightUpBevelFrame.ToString();
            tbNRightUpBevelName.Text = PublicSet.Myset.NRightUpBevelName;
            tbNRightUpBevelCompensate.Text = PublicSet.Myset.NRightUpBevelCompensate.ToString();
            //负左下
            cbNLeftDownBevelSwitch.Checked = PublicSet.Myset.NLeftDownBevelSwitch;
            tbNLeftDownBevelGrayMin.Text = PublicSet.Myset.NLeftDownBevelGrayMin.ToString();
            tbNLeftDownBevelAreaMin.Text = PublicSet.Myset.NLeftDownBevelAreaMin.ToString();
            tbNLeftDownBevelAreaMax.Text = PublicSet.Myset.NLeftDownBevelAreaMax.ToString();
            tbNLeftDownBevelFrame.Text = PublicSet.Myset.NLeftDownBevelFrame.ToString();
            tbNLeftDownBevelName.Text = PublicSet.Myset.NLeftDownBevelName;
            tbNLeftDownBevelCompensate.Text = PublicSet.Myset.NLeftDownBevelCompensate.ToString();
            //负右下
            cbNRightDownBevelSwitch.Checked = PublicSet.Myset.NRightDownBevelSwitch;
            tbNRightDownBevelGrayMin.Text = PublicSet.Myset.NRightDownBevelGrayMin.ToString();
            tbNRightDownBevelAreaMin.Text = PublicSet.Myset.NRightDownBevelAreaMin.ToString();
            tbNRightDownBevelAreaMax.Text = PublicSet.Myset.NRightDownBevelAreaMax.ToString();
            tbNRightDownBevelFrame.Text = PublicSet.Myset.NRightDownBevelFrame.ToString();
            tbNRightDownBevelName.Text = PublicSet.Myset.NRightDownBevelName;
            tbNRightDownBevelCompensate.Text = PublicSet.Myset.NRightDownBevelCompensate.ToString();


            //正极三角形 矩形开关
            cBPBevelTriangleSwitch.Checked = PublicSet.Myset.PBevelTriangleSwitch;
            //正左上
            cbPLeftUpBevelSwitch.Checked = PublicSet.Myset.PLeftUpBevelSwitch;
            tbPLeftUpBevelGrayMin.Text = PublicSet.Myset.PLeftUpBevelGrayMin.ToString();
            tbPLeftUpBevelAreaMin.Text = PublicSet.Myset.PLeftUpBevelAreaMin.ToString();
            tbPLeftUpBevelAreaMax.Text = PublicSet.Myset.PLeftUpBevelAreaMax.ToString();
            tbPLeftUpBevelFrame.Text = PublicSet.Myset.PLeftUpBevelFrame.ToString();
            tbPLeftUpBevelName.Text = PublicSet.Myset.PLeftUpBevelName;
            tbPLeftUpBevelCompensate.Text = PublicSet.Myset.PLeftUpBevelCompensate.ToString();
            //正右上
            cbPRightUpBevelSwitch.Checked = PublicSet.Myset.PRightUpBevelSwitch;
            tbPRightUpBevelGrayMin.Text = PublicSet.Myset.PRightUpBevelGrayMin.ToString();
            tbPRightUpBevelAreaMin.Text = PublicSet.Myset.PRightUpBevelAreaMin.ToString();
            tbPRightUpBevelAreaMax.Text = PublicSet.Myset.PRightUpBevelAreaMax.ToString();
            tbPRightUpBevelFrame.Text = PublicSet.Myset.PRightUpBevelFrame.ToString();
            tbPRightUpBevelName.Text = PublicSet.Myset.PRightUpBevelName;
            tbPRightUpBevelCompensate.Text = PublicSet.Myset.PRightUpBevelCompensate.ToString();
            //正左下
            cbPLeftDownBevelSwitch.Checked = PublicSet.Myset.PLeftDownBevelSwitch;
            tbPLeftDownBevelGrayMin.Text = PublicSet.Myset.PLeftDownBevelGrayMin.ToString();
            tbPLeftDownBevelAreaMin.Text = PublicSet.Myset.PLeftDownBevelAreaMin.ToString();
            tbPLeftDownBevelAreaMax.Text = PublicSet.Myset.PLeftDownBevelAreaMax.ToString();
            tbPLeftDownBevelFrame.Text = PublicSet.Myset.PLeftDownBevelFrame.ToString();
            tbPLeftDownBevelName.Text = PublicSet.Myset.PLeftDownBevelName;
            tbPLeftDownBevelCompensate.Text = PublicSet.Myset.PLeftDownBevelCompensate.ToString();
            //正右下
            cbPRightDownBevelSwitch.Checked = PublicSet.Myset.PRightDownBevelSwitch;
            tbPRightDownBevelGrayMin.Text = PublicSet.Myset.PRightDownBevelGrayMin.ToString();
            tbPRightDownBevelAreaMin.Text = PublicSet.Myset.PRightDownBevelAreaMin.ToString();
            tbPRightDownBevelAreaMax.Text = PublicSet.Myset.PRightDownBevelAreaMax.ToString();
            tbPRightDownBevelFrame.Text = PublicSet.Myset.PRightDownBevelFrame.ToString();
            tbPRightDownBevelName.Text = PublicSet.Myset.PRightDownBevelName;
            tbPRightDownBevelCompensate.Text = PublicSet.Myset.PRightDownBevelCompensate.ToString();

            if (PublicSet.Myset.DetectMode == "3相机正负单测" && PublicSet.Myset.NegativeSwitch)
            {
                groupBox1.Enabled = false;
            }
            if (PublicSet.Myset.DetectMode == "3相机正负单测" && PublicSet.Myset.PositiveSwitch)
            {
                groupBox3.Enabled = false;
            }
        }
        /// <summary>
        /// 存储设置UI
        /// </summary>
        public void StorageSetUI()
        {
            cbImageIstitching.Checked = PublicSet.Myset.ImageIstitching;
            cbImageEncryption.Checked = PublicSet.Myset.ImageEncryption;

            cbOriginalPictureSwitch.Checked = PublicSet.Myset.OriginalPictureSwitch;
            tbPathO.Text = PublicSet.Myset.PathO;
            tBNamingRuleO.Text = PublicSet.Myset.NamingRuleO;
            nudDayO.Text = PublicSet.Myset.DayO.ToString();
            cbImangeFormatO.Text = PublicSet.Myset.ImangeFormatO;

            cbNGOriginalPictureSwitch.Checked = PublicSet.Myset.NGOriginalPictureSwitch;
            tbPathNGO.Text = PublicSet.Myset.PathNGO;
            tBNamingRuleNGO.Text = PublicSet.Myset.NamingRuleNGO;
            nudDayNGO.Text = PublicSet.Myset.DayNGO.ToString();
            cbImangeFormatNGO.Text = PublicSet.Myset.ImangeFormatNGO;

            cbEffectPictureSwitch.Checked = PublicSet.Myset.EffectPictureSwitch;
            tbPathE.Text = PublicSet.Myset.PathE;
            tBNamingRuleE.Text = PublicSet.Myset.NamingRuleE;
            nudDayE.Text = PublicSet.Myset.DayE.ToString();
            cbImangeFormatE.Text = PublicSet.Myset.ImangeFormatE;

            cbNGPictureSwitch.Checked = PublicSet.Myset.NGPictureSwitch;
            tbPathNG.Text = PublicSet.Myset.PathNG;
            tBNamingRuleNG.Text = PublicSet.Myset.NamingRuleNG;
            nudDayNG.Text = PublicSet.Myset.DayNG.ToString();
            cbImangeFormatNG.Text = PublicSet.Myset.ImangeFormatNG;

            cbMESPictureSwitch.Checked = PublicSet.Myset.MESPictureSwitch;
            tbPathMES.Text = PublicSet.Myset.PathMES;
            tBNamingRuleMES.Text = PublicSet.Myset.NamingRuleMES;
            cbImangeFormatMES.Text = PublicSet.Myset.ImangeFormatMES;

            tbSCDataSava.Text = PublicSet.Myset.SCDataSava;
            tbTJDataSava.Text = PublicSet.Myset.TJDataSava;
            tbPWDataSava.Text = PublicSet.Myset.PWDataSava;
            tbMESDataSava.Text = PublicSet.Myset.MESDataSava;
            cbMESDataSwitch.Checked = PublicSet.Myset.MESDataSwitch;


            nudSCDataSavaDay.Text = PublicSet.Myset.SCDataSavaDay.ToString();
            nudTJDataSavaDay.Text = PublicSet.Myset.TJDataSavaDay.ToString();
            nudPWDataSavaDay.Text = PublicSet.Myset.PWDataSavaDay.ToString();
            nudMESDataSavaDay.Text = PublicSet.Myset.MESDataSavaDay.ToString();

            tbSCName.Text = PublicSet.Myset.SCName;
            tbTJName.Text = PublicSet.Myset.TJName;
            tbPWName.Text = PublicSet.Myset.PWName;
            tbMESName.Text = PublicSet.Myset.MESName;


            dtpMornHour.Value = DateTime.Parse(PublicSet.Myset.Morn);
            dtpNightHour.Value = DateTime.Parse(PublicSet.Myset.Night);

            tbLineID.Text = PublicSet.Cameraset.LineID;
            tbMachineID.Text = PublicSet.Cameraset.MachineID;

            tbPathLog.Text = PublicSet.Myset.PathLog;
        }
        /// <summary>
        /// 数据库与配方设置ui
        /// </summary>
        public void DataBaseSetUI()
        {
            try
            {
                tbMySqlServer.Text = PublicSet.Myset.MySqlServer;
                tbMySqlUserId.Text = PublicSet.Myset.MySqlUserId;
                tbMySqlPassword.Text = PublicSet.Myset.MySqlPassword;
                QueryUserInfo();
                string[] s = Directory.GetDirectories("Config");
                //清空产品列表
                dGVProductList.Rows.Clear();
                foreach (var item in s)//将上面字符串数组  S 依次传给 item
                {
                    string[] s1 = item.Split('\\');//依次分割
                    dGVProductList.Rows.Insert(0, s1[s1.Length - 1]);//依次添加到产品列表里
                }
                foreach (DataGridViewRow row in dGVProductList.Rows) // 遍历整个DataGridView
                {
                    if (row.Cells["ColName"].Value != null && row.Cells["ColName"].Value.ToString() == PublicSet.ProductNmae) // 与变量值比较
                    {
                        row.DefaultCellStyle.BackColor = Color.Green; // 设置背景颜色
                    }
                    else
                    {
                        row.DefaultCellStyle.BackColor = Color.White; // 设置默认背景颜色
                    }
                }
                lProductName.Text = $"当前产品型号：{PublicSet.ProductNmae}，在产品列表中双击即可切换型号";
                dGVProductList.ClearSelection();
            }
            catch (Exception ex)
            {

                Tool.LogForm("设置读取用户失败" + ex.ToString());
            }

        }
        /// <summary>
        /// 系统设置UI
        /// </summary>
        public void SystemSetUI()
        {
            cbDataPrioritySwitch.Checked = PublicSet.Myset.DataPrioritySwitch;

            cbDetectMode.SelectedItem = PublicSet.Myset.DetectMode;
            if (PublicSet.Myset.DetectMode == "4相机正负单测" || PublicSet.Myset.DetectMode == "3相机正负单测")
            {
                cbPositiveSwitch.Checked = PublicSet.Myset.PositiveSwitch;
                cbNegativeSwitch.Checked = PublicSet.Myset.NegativeSwitch;
            }
            cbNullSliceP.Checked = PublicSet.Myset.NullSliceP;
            cbNullSliceN.Checked = PublicSet.Myset.NullSliceN;
            tbpicFileName.Text = PublicSet.Myset.picFileName;
            tbiconFileName.Text = PublicSet.Myset.iconFileName;
            cbTJ_Hour.Checked = PublicSet.Myset.TJ_Hour;
            cbEarlyWarning.Checked = PublicSet.Myset.EarlyWarning;

            tbNLeftArcSize.Text = PublicSet.Myset.NLeftArcSize.ToString();
            tbPLeftArcSize.Text = PublicSet.Myset.PLeftArcSize.ToString();
            tbNLeftArcColSkew.Text = PublicSet.Myset.NLeftArcColSkew.ToString();
            tbPLeftArcColSkew.Text = PublicSet.Myset.PLeftArcColSkew.ToString();
            tbNLeftArcRowSkew.Text = PublicSet.Myset.NLeftArcRowSkew.ToString();
            tbPLeftArcRowSkew.Text = PublicSet.Myset.PLeftArcRowSkew.ToString();

            tbNRightArcSize.Text = PublicSet.Myset.NRightArcSize.ToString();
            tbPRightArcSize.Text = PublicSet.Myset.PRightArcSize.ToString();
            tbNRightArcColSkew.Text = PublicSet.Myset.NRightArcColSkew.ToString();
            tbPRightArcColSkew.Text = PublicSet.Myset.PRightArcColSkew.ToString();
            tbNRightArcRowSkew.Text = PublicSet.Myset.NRightArcRowSkew.ToString();
            tbPRightArcRowSkew.Text = PublicSet.Myset.PRightArcRowSkew.ToString();
            if (PublicSet.Myset.NJELeftShoulderArc || PublicSet.Myset.NJERightShoulderArc || PublicSet.Myset.PJELeftShoulderArc || PublicSet.Myset.PJERightShoulderArc)
            {
                gbArc.Visible = true;
            }
            else
            {
                gbArc.Visible = false;
            }
            cbOEEData.Checked = PublicSet.Myset.OEEData;
            cbSwipingCardLogin.Checked = PublicSet.Myset.SwipingCardLogin;
            radioButton13.Visible = label57.Visible = cbPJELocation1.Visible = label56.Visible = cbNJELocation1.Visible = cbJETwoCamera.Checked = PublicSet.Myset.JETwoCamera;

        }


        #endregion

        #region 保存参数

        /// <summary>
        /// 保存相机设置
        /// </summary>
        public void SaveCamera()
        {
            if (!UiCamera) return;



            //相机标识                   
            PublicSet.Cameraset.NLeftUpCamera = cbNLeftUpCamera.Text;
            PublicSet.Cameraset.NRightUpCamera = cbNRightUpCamera.Text;
            PublicSet.Cameraset.NLeftDownCamera = cbNLeftDownCamera.Text;
            PublicSet.Cameraset.NRightDownCamera = cbNRightDownCamera.Text;
            PublicSet.Cameraset.PLeftUpCamera = cbPLeftUpCamera.Text;
            PublicSet.Cameraset.PRightUpCamera = cbPRightUpCamera.Text;
            PublicSet.Cameraset.PLeftDownCamera = cbPLeftDownCamera.Text;
            PublicSet.Cameraset.PRightDownCamera = cbPRightDownCamera.Text;
            //像素比列
            PublicSet.Cameraset.NLeftUpCamreraPixelRatio = Convert.ToDouble(tbNLeftUpCamreraPixelRatio.Text);
            PublicSet.Cameraset.NRightUpCamreraPixelRatio = Convert.ToDouble(tbNRightUpCamreraPixelRatio.Text);
            PublicSet.Cameraset.NLeftDownCamreraPixelRatio = Convert.ToDouble(tbNLeftDownCamreraPixelRatio.Text);
            PublicSet.Cameraset.NRightDownCamreraPixelRatio = Convert.ToDouble(tbNRightDownCamreraPixelRatio.Text);
            PublicSet.Cameraset.PLeftUpCamreraPixelRatio = Convert.ToDouble(tbPLeftUpCamreraPixelRatio.Text);
            PublicSet.Cameraset.PRightUpCamreraPixelRatio = Convert.ToDouble(tbPRightUpCamreraPixelRatio.Text);
            PublicSet.Cameraset.PLeftDownCamreraPixelRatio = Convert.ToDouble(tbPLeftDownCamreraPixelRatio.Text);
            PublicSet.Cameraset.PRightDownCamreraPixelRatio = Convert.ToDouble(tbPRightDownCamreraPixelRatio.Text);
            //自定义命名
            PublicSet.Cameraset.NLeftUpCamreraName = tbNLeftUpCamreraName.Text;
            PublicSet.Cameraset.NRightUpCamreraName = tbNRightUpCamreraName.Text;
            PublicSet.Cameraset.NLeftDownCamreraName = tbNLeftDownCamreraName.Text;
            PublicSet.Cameraset.NRightDownCamreraName = tbNRightDownCamreraName.Text;
            PublicSet.Cameraset.PLeftUpCamreraName = tbPLeftUpCamreraName.Text;
            PublicSet.Cameraset.PRightUpCamreraName = tbPRightUpCamreraName.Text;
            PublicSet.Cameraset.PLeftDownCamreraName = tbPLeftDownCamreraName.Text;
            PublicSet.Cameraset.PRightDownCamreraName = tbPRightDownCamreraName.Text;
            PublicSet.Myset.PJELocation = cbPJELocation.Text;
            PublicSet.Myset.NJELocation = cbNJELocation.Text;
            PublicSet.Myset.PJELocation1 = cbPJELocation1.Text;
            PublicSet.Myset.NJELocation1 = cbNJELocation1.Text;
            Get_Text(gbCamera);
        }
        /// <summary>
        /// 保存通讯设置
        /// </summary>
        public void SaveCommunicate()
        {
            if (RadioCIP.Checked) PublicSet.Myset.StrPlcTcp = "CIP";
            if (RadioFins.Checked) PublicSet.Myset.StrPlcTcp = "Fins";
            if (RadioAB.Checked) PublicSet.Myset.StrPlcTcp = "AB";
            if (RadioCK.Checked) PublicSet.Myset.StrPlcTcp = "CK";
            if (RadioTCP.Checked) PublicSet.Myset.StrPlcTcp = "TCP";
            if (RadioMB.Checked) PublicSet.Myset.StrPlcTcp = "MB";
            if (RadioEIP.Checked) PublicSet.Myset.StrPlcTcp = "EIP";
            if (RadioNCGX.Checked) PublicSet.Myset.StrPlcTcp = "内存共享";



            PublicSet.Myset.IP = tbIP.Text;
            PublicSet.Myset.ComputerIP = tbComputerIP.Text;

            PublicSet.Myset.DClient = tbDClient.Text;
            PublicSet.Myset.Client = tbClient.Text;
            PublicSet.Myset.TriggerPhotographAddrees = tbTriggerPhotographAddrees.Text;
            PublicSet.Myset.NGisok = tbNGisok.Text;

            PublicSet.Myset.OKNGAddress = tbOKNGAddress.Text;
            PublicSet.Myset.HeartbeatAddress = tbHeartbeatAddress.Text;
            PublicSet.Myset.NGcountAddress = tbNGcountAddress.Text;
            PublicSet.Myset.CraftAddress = tbCraftAddress.Text;
            PublicSet.Myset.ReadCraftAddress = tbReadCraftAddress.Text;

            PublicSet.Myset.PoleReelN = tbPoleReelN.Text;
            PublicSet.Myset.PoleReelP = tbPoleReelP.Text;

            PublicSet.Myset.ChangeOfLapAddressN = tbChangeOfLapAddressN.Text;
            PublicSet.Myset.ChangeOfLapAddressP = tbChangeOfLapAddressP.Text;


            PublicSet.Myset.RollingDiameterAddressN = tbRollingDiameterAddressN.Text;
            PublicSet.Myset.RollingDiameterAddressP = tbRollingDiameterAddressP.Text;

            PublicSet.Myset.LoginVerifyN = tbLoginVerifyN.Text;
            PublicSet.Myset.LoginVerifyP = tbLoginVerifyP.Text;
            PublicSet.Myset.LoginUserName = tbLoginUserName.Text;
            PublicSet.Myset.LoginUserPower = tbLoginUserPower.Text;

            Get_Bool(gbCommunicationMode);//通讯方式
            Get_Text(gbCommunicationIP);//通讯地址
            Get_Text(gbCommunicationParam);//通讯地址参数

        }
        /// <summary>
        /// 保存负极工艺设置
        /// </summary>
        public void SaveNCraft()
        {
            bool bb = lNJPHeadWidth.Visible;
            //极片头宽
            PublicSet.Myset.NJPHeadWidthSwitch = cbNJPHeadWidthSwitch.Checked;
            PublicSet.Myset.NJPHeadWidthStandard = Convert.ToDouble(tbNJPHeadWidthStandard.Text);
            PublicSet.Myset.NJPHeadWidthMax = Convert.ToDouble(tbNJPHeadWidthMax.Text);
            PublicSet.Myset.NJPHeadWidthMin = Convert.ToDouble(tbNJPHeadWidthMin.Text);
            PublicSet.Myset.NJPHeadWidthName = tbNJPHeadWidthName.Text;
            PublicSet.Cameraset.NJPHeadWidthCompensate = Convert.ToDouble(tbNJPHeadWidthCompensate.Text);
            PublicSet.Myset.NJPHeadWidthRange = $"{PublicSet.Myset.NJPHeadWidthStandard}±{(PublicSet.Myset.NJPHeadWidthMax - PublicSet.Myset.NJPHeadWidthStandard).ToString("0.00")}：";

            //极片尾宽
            PublicSet.Myset.NJPTailWidthSwitch = cbNJPTailWidthSwitch.Checked;
            PublicSet.Myset.NJPTailWidthStandard = Convert.ToDouble(tbNJPTailWidthStandard.Text);
            PublicSet.Myset.NJPTailWidthMax = Convert.ToDouble(tbNJPTailWidthMax.Text);
            PublicSet.Myset.NJPTailWidthMin = Convert.ToDouble(tbNJPTailWidthMin.Text);
            PublicSet.Myset.NJPTailWidthName = tbNJPTailWidthName.Text;
            PublicSet.Cameraset.NJPTailWidthCompensate = Convert.ToDouble(tbNJPTailWidthCompensate.Text);
            PublicSet.Myset.NJPTailWidthRange = $"{PublicSet.Myset.NJPTailWidthStandard}±{(PublicSet.Myset.NJPTailWidthMax - PublicSet.Myset.NJPTailWidthStandard).ToString("0.00")}：";
            //极片头长
            PublicSet.Myset.NJPHeadLengthSwitch = cbNJPHeadLengthSwitch.Checked;
            PublicSet.Myset.NJPHeadLengthStandard = Convert.ToDouble(tbNJPHeadLengthStandard.Text);
            PublicSet.Myset.NJPHeadLengthMax = Convert.ToDouble(tbNJPHeadLengthMax.Text);
            PublicSet.Myset.NJPHeadLengthMin = Convert.ToDouble(tbNJPHeadLengthMin.Text);
            PublicSet.Myset.NJPHeadLengthName = tbNJPHeadLengthName.Text;
            PublicSet.Cameraset.NJPHeadLengthCompensate = Convert.ToDouble(tbNJPHeadLengthCompensate.Text);
            PublicSet.Myset.NJPHeadLengthRange = $"{PublicSet.Myset.NJPHeadLengthStandard}±{(PublicSet.Myset.NJPHeadLengthMax - PublicSet.Myset.NJPHeadLengthStandard).ToString("0.00")}：";
            //极片尾长
            PublicSet.Myset.NJPTailLengthSwitch = cbNJPTailLengthSwitch.Checked;
            PublicSet.Myset.NJPTailLengthStandard = Convert.ToDouble(tbNJPTailLengthStandard.Text);
            PublicSet.Myset.NJPTailLengthMax = Convert.ToDouble(tbNJPTailLengthMax.Text);
            PublicSet.Myset.NJPTailLengthMin = Convert.ToDouble(tbNJPTailLengthMin.Text);
            PublicSet.Myset.NJPTailLengthName = tbNJPTailLengthName.Text;
            PublicSet.Cameraset.NJPTailLengthCompensate = Convert.ToDouble(tbNJPTailLengthCompensate.Text);
            PublicSet.Myset.NJPTailLengthRange = $"{PublicSet.Myset.NJPTailLengthStandard}±{(PublicSet.Myset.NJPTailLengthMax - PublicSet.Myset.NJPTailLengthStandard).ToString("0.00")}：";
            //左肩宽
            PublicSet.Myset.NJELeftShoulderSwitch = cbNJELeftShoulderSwitch.Checked;
            PublicSet.Myset.NJELeftShoulderStandard = Convert.ToDouble(tbNJELeftShoulderStandard.Text);
            PublicSet.Myset.NJELeftShoulderMax = Convert.ToDouble(tbNJELeftShoulderMax.Text);
            PublicSet.Myset.NJELeftShoulderMin = Convert.ToDouble(tbNJELeftShoulderMin.Text);
            PublicSet.Myset.NJELeftShoulderName = tbNJELeftShoulderName.Text;
            PublicSet.Cameraset.NJELeftShoulderCompensate = Convert.ToDouble(tbNJELeftShoulderCompensate.Text);
            PublicSet.Myset.NJELeftShoulderRange = $"{PublicSet.Myset.NJELeftShoulderStandard}±{(PublicSet.Myset.NJELeftShoulderMax - PublicSet.Myset.NJELeftShoulderStandard).ToString("0.00")}：";
            //右肩宽
            PublicSet.Myset.NJERightShoulderSwitch = cbNJERightShoulderSwitch.Checked;
            PublicSet.Myset.NJERightShoulderStandard = Convert.ToDouble(tbNJERightShoulderStandard.Text);
            PublicSet.Myset.NJERightShoulderMax = Convert.ToDouble(tbNJERightShoulderMax.Text);
            PublicSet.Myset.NJERightShoulderMin = Convert.ToDouble(tbNJERightShoulderMin.Text);
            PublicSet.Myset.NJERightShoulderName = tbNJERightShoulderName.Text;
            PublicSet.Cameraset.NJERightShoulderCompensate = Convert.ToDouble(tbNJERightShoulderCompensate.Text);
            PublicSet.Myset.NJERightShoulderRange = $"{PublicSet.Myset.NJERightShoulderStandard}±{(PublicSet.Myset.NJERightShoulderMax - PublicSet.Myset.NJERightShoulderStandard).ToString("0.00")}：";
            //极耳宽
            PublicSet.Myset.NJEWidthSwitch = cbNJEWidthSwitch.Checked;
            PublicSet.Myset.NJEWidthStandard = Convert.ToDouble(tbNJEWidthStandard.Text);
            PublicSet.Myset.NJEWidthMax = Convert.ToDouble(tbNJEWidthMax.Text);
            PublicSet.Myset.NJEWidthMin = Convert.ToDouble(tbNJEWidthMin.Text);
            PublicSet.Myset.NJEWidthName = tbNJEWidthName.Text;
            PublicSet.Cameraset.NJEWidthCompensate = Convert.ToDouble(tbNJEWidthCompensate.Text);
            PublicSet.Myset.NJEWidthRange = $"{PublicSet.Myset.NJEWidthStandard}±{(PublicSet.Myset.NJEWidthMax - PublicSet.Myset.NJEWidthStandard).ToString("0.00")}：";
            //极耳高
            PublicSet.Myset.NJEHeightSwitch = cbNJEHeightSwitch.Checked;
            PublicSet.Myset.NJEHeightStandard = Convert.ToDouble(tbNJEHeightStandard.Text);
            PublicSet.Myset.NJEHeightMax = Convert.ToDouble(tbNJEHeightMax.Text);
            PublicSet.Myset.NJEHeightMin = Convert.ToDouble(tbNJEHeightMin.Text);
            PublicSet.Myset.NJEHeightName = tbNJEHeightName.Text;
            PublicSet.Cameraset.NJEHeightCompensate = Convert.ToDouble(tbNJEHeightCompensate.Text);
            PublicSet.Myset.NJEHeightRange = $"{PublicSet.Myset.NJEHeightStandard}±{(PublicSet.Myset.NJEHeightMax - PublicSet.Myset.NJEHeightStandard).ToString("0.00")}：";
            //带料高
            PublicSet.Myset.NDLHeightSwitch = cbNDLHeightSwitch.Checked;
            PublicSet.Myset.NDLHeightStandard = Convert.ToDouble(tbNDLHeightStandard.Text);
            PublicSet.Myset.NDLHeightMax = Convert.ToDouble(tbNDLHeightMax.Text);
            PublicSet.Myset.NDLHeightMin = Convert.ToDouble(tbNDLHeightMin.Text);
            PublicSet.Myset.NDLHeightName = tbNDLHeightName.Text;
            PublicSet.Cameraset.NDLHeightCompensate = Convert.ToDouble(tbNDLHeightCompensate.Text);
            PublicSet.Myset.NDLHeightRange = $"{PublicSet.Myset.NDLHeightStandard}±{(PublicSet.Myset.NDLHeightMax - PublicSet.Myset.NDLHeightStandard).ToString("0.00")}：";
            //总宽
            PublicSet.Myset.NJPTotalWidthSwitch = cbNJPTotalWidthSwitch.Checked;
            PublicSet.Myset.NJPTotalWidthStandard = Convert.ToDouble(tbNJPTotalWidthStandard.Text);
            PublicSet.Myset.NJPTotalWidthMax = Convert.ToDouble(tbNJPTotalWidthMax.Text);
            PublicSet.Myset.NJPTotalWidthMin = Convert.ToDouble(tbNJPTotalWidthMin.Text);
            PublicSet.Myset.NJPTotalWidthName = tbNJPTotalWidthName.Text;
            PublicSet.Cameraset.NJPTotalWidthCompensate = Convert.ToDouble(tbNJPTotalWidthCompensate.Text);
            PublicSet.Myset.NJPTotalWidthRange = $"{PublicSet.Myset.NJPTotalWidthStandard}±{(PublicSet.Myset.NJPTotalWidthMax - PublicSet.Myset.NJPTotalWidthStandard).ToString("0.00")}：";
            //涂布高
            PublicSet.Myset.NJPCoatingSwitch = cbNJPCoatingSwitch.Checked;
            PublicSet.Myset.NJPCoatingStandard = Convert.ToDouble(tbNJPCoatingStandard.Text);
            PublicSet.Myset.NJPCoatingMax = Convert.ToDouble(tbNJPCoatingMax.Text);
            PublicSet.Myset.NJPCoatingMin = Convert.ToDouble(tbNJPCoatingMin.Text);
            PublicSet.Myset.NJPCoatingName = tbNJPCoatingName.Text;
            PublicSet.Cameraset.NJPCoatingCompensate = Convert.ToDouble(tbNJPCoatingCompensate.Text);
            PublicSet.Myset.NJPCoatingRange = $"{PublicSet.Myset.NJPCoatingStandard}±{(PublicSet.Myset.NJPCoatingMax - PublicSet.Myset.NJPCoatingStandard).ToString("0.00")}：";
            //对角线
            PublicSet.Myset.NDiagonalSwitch = cbNDiagonalSwitch.Checked;
            PublicSet.Myset.NDiagonalStandard = Convert.ToDouble(tbNDiagonalStandard.Text);
            PublicSet.Myset.NDiagonalMax = Convert.ToDouble(tbNDiagonalMax.Text);
            PublicSet.Myset.NDiagonalMin = Convert.ToDouble(tbNDiagonalMin.Text);
            PublicSet.Myset.NDiagonalName = tbNDiagonalName.Text;
            PublicSet.Cameraset.NDiagonalCompensate = Convert.ToDouble(tbNDiagonalCompensate.Text);
            PublicSet.Myset.NDiagonalRange = $"{PublicSet.Myset.NDiagonalStandard}±{(PublicSet.Myset.NDiagonalMax - PublicSet.Myset.NDiagonalStandard).ToString("0.00")}：";
            //左上垂直角度
            PublicSet.Myset.NLeftUpAngleSwitch = cbNLeftUpAngleSwitch.Checked;
            PublicSet.Myset.NLeftUpAngleStandard = Convert.ToDouble(tbNLeftUpAngleStandard.Text);
            PublicSet.Myset.NLeftUpAngleMax = Convert.ToDouble(tbNLeftUpAngleMax.Text);
            PublicSet.Myset.NLeftUpAngleMin = Convert.ToDouble(tbNLeftUpAngleMin.Text);
            PublicSet.Myset.NLeftUpAngleName = tbNLeftUpAngleName.Text;
            PublicSet.Cameraset.NLeftUpAngleCompensate = Convert.ToDouble(tbNLeftUpAngleCompensate.Text);
            PublicSet.Myset.NLeftUpAngleRange = $"{PublicSet.Myset.NLeftUpAngleStandard}±{(PublicSet.Myset.NLeftUpAngleMax - PublicSet.Myset.NLeftUpAngleStandard).ToString("0.00")}：";
            //右上垂直角度
            PublicSet.Myset.NRightUpAngleSwitch = cbNRightUpAngleSwitch.Checked;
            PublicSet.Myset.NRightUpAngleStandard = Convert.ToDouble(tbNRightUpAngleStandard.Text);
            PublicSet.Myset.NRightUpAngleMax = Convert.ToDouble(tbNRightUpAngleMax.Text);
            PublicSet.Myset.NRightUpAngleMin = Convert.ToDouble(tbNRightUpAngleMin.Text);
            PublicSet.Myset.NRightUpAngleName = tbNRightUpAngleName.Text;
            PublicSet.Cameraset.NRightUpAngleCompensate = Convert.ToDouble(tbNRightUpAngleCompensate.Text);
            PublicSet.Myset.NRightUpAngleRange = $"{PublicSet.Myset.NRightUpAngleStandard}±{(PublicSet.Myset.NRightUpAngleMax - PublicSet.Myset.NRightUpAngleStandard).ToString("0.00")}：";
            //左下垂直角度
            PublicSet.Myset.NLeftDownAngleSwitch = cbNLeftDownAngleSwitch.Checked;
            PublicSet.Myset.NLeftDownAngleStandard = Convert.ToDouble(tbNLeftDownAngleStandard.Text);
            PublicSet.Myset.NLeftDownAngleMax = Convert.ToDouble(tbNLeftDownAngleMax.Text);
            PublicSet.Myset.NLeftDownAngleMin = Convert.ToDouble(tbNLeftDownAngleMin.Text);
            PublicSet.Myset.NLeftDownAngleName = tbNLeftDownAngleName.Text;
            PublicSet.Cameraset.NLeftDownAngleCompensate = Convert.ToDouble(tbNLeftDownAngleCompensate.Text);
            PublicSet.Myset.NLeftDownAngleRange = $"{PublicSet.Myset.NLeftDownAngleStandard}±{(PublicSet.Myset.NLeftDownAngleMax - PublicSet.Myset.NLeftDownAngleStandard).ToString("0.00")}：";
            //右下垂直角度
            PublicSet.Myset.NRightDownAngleSwitch = cbNRightDownAngleSwitch.Checked;
            PublicSet.Myset.NRightDownAngleStandard = Convert.ToDouble(tbNRightDownAngleStandard.Text);
            PublicSet.Myset.NRightDownAngleMax = Convert.ToDouble(tbNRightDownAngleMax.Text);
            PublicSet.Myset.NRightDownAngleMin = Convert.ToDouble(tbNRightDownAngleMin.Text);
            PublicSet.Myset.NRightDownAngleName = tbNRightDownAngleName.Text;
            PublicSet.Cameraset.NRightDownAngleCompensate = Convert.ToDouble(tbNRightDownAngleCompensate.Text);
            PublicSet.Myset.NRightDownAngleRange = $"{PublicSet.Myset.NRightDownAngleStandard}±{(PublicSet.Myset.NRightDownAngleMax - PublicSet.Myset.NRightDownAngleStandard).ToString("0.00")}：";
            //mark点
            PublicSet.Myset.NMarkSwitch = cbNMarkSwitch.Checked;
            PublicSet.Myset.NMarkMin = Convert.ToDouble(tbNMarkMin.Text);
            PublicSet.Myset.NMarkMax = Convert.ToDouble(tbNMarkMax.Text);

            PublicSet.Myset.ChangeSet = true;
            Get_Bool(tab3);//负极工艺
            Get_Text(tab3);//负极工艺
            Get_Text(gbNCompensate);//负极工艺

        }
        /// <summary>
        /// 保存正极工艺设置
        /// </summary>
        public void SavePCraft()
        {
            //极片头宽
            PublicSet.Myset.PJPHeadWidthSwitch = cbPJPHeadWidthSwitch.Checked;
            PublicSet.Myset.PJPHeadWidthStandard = Convert.ToDouble(tbPJPHeadWidthStandard.Text);
            PublicSet.Myset.PJPHeadWidthMax = Convert.ToDouble(tbPJPHeadWidthMax.Text);
            PublicSet.Myset.PJPHeadWidthMin = Convert.ToDouble(tbPJPHeadWidthMin.Text);
            PublicSet.Myset.PJPHeadWidthName = tbPJPHeadWidthName.Text;
            PublicSet.Cameraset.PJPHeadWidthCompensate = Convert.ToDouble(tbPJPHeadWidthCompensate.Text);
            PublicSet.Myset.PJPHeadWidthRange = $"{PublicSet.Myset.PJPHeadWidthStandard}±{(PublicSet.Myset.PJPHeadWidthMax - PublicSet.Myset.PJPHeadWidthStandard).ToString("0.00")}：";
            //极片尾宽
            PublicSet.Myset.PJPTailWidthSwitch = cbPJPTailWidthSwitch.Checked;
            PublicSet.Myset.PJPTailWidthStandard = Convert.ToDouble(tbPJPTailWidthStandard.Text);
            PublicSet.Myset.PJPTailWidthMax = Convert.ToDouble(tbPJPTailWidthMax.Text);
            PublicSet.Myset.PJPTailWidthMin = Convert.ToDouble(tbPJPTailWidthMin.Text);
            PublicSet.Myset.PJPTailWidthName = tbPJPTailWidthName.Text;
            PublicSet.Cameraset.PJPTailWidthCompensate = Convert.ToDouble(tbPJPTailWidthCompensate.Text);
            PublicSet.Myset.PJPTailWidthRange = $"{PublicSet.Myset.PJPTailWidthStandard}±{(PublicSet.Myset.PJPTailWidthMax - PublicSet.Myset.PJPTailWidthStandard).ToString("0.00")}：";
            //极片头长
            PublicSet.Myset.PJPHeadLengthSwitch = cbPJPHeadLengthSwitch.Checked;
            PublicSet.Myset.PJPHeadLengthStandard = Convert.ToDouble(tbPJPHeadLengthStandard.Text);
            PublicSet.Myset.PJPHeadLengthMax = Convert.ToDouble(tbPJPHeadLengthMax.Text);
            PublicSet.Myset.PJPHeadLengthMin = Convert.ToDouble(tbPJPHeadLengthMin.Text);
            PublicSet.Myset.PJPHeadLengthName = tbPJPHeadLengthName.Text;
            PublicSet.Cameraset.PJPHeadLengthCompensate = Convert.ToDouble(tbPJPHeadLengthCompensate.Text);
            PublicSet.Myset.PJPHeadLengthRange = $"{PublicSet.Myset.PJPHeadLengthStandard}±{(PublicSet.Myset.PJPHeadLengthMax - PublicSet.Myset.PJPHeadLengthStandard).ToString("0.00")}：";
            //极片尾长
            PublicSet.Myset.PJPTailLengthSwitch = cbPJPTailLengthSwitch.Checked;
            PublicSet.Myset.PJPTailLengthStandard = Convert.ToDouble(tbPJPTailLengthStandard.Text);
            PublicSet.Myset.PJPTailLengthMax = Convert.ToDouble(tbPJPTailLengthMax.Text);
            PublicSet.Myset.PJPTailLengthMin = Convert.ToDouble(tbPJPTailLengthMin.Text);
            PublicSet.Myset.PJPTailLengthName = tbPJPTailLengthName.Text;
            PublicSet.Cameraset.PJPTailLengthCompensate = Convert.ToDouble(tbPJPTailLengthCompensate.Text);
            PublicSet.Myset.PJPTailLengthRange = $"{PublicSet.Myset.PJPTailLengthStandard}±{(PublicSet.Myset.PJPTailLengthMax - PublicSet.Myset.PJPTailLengthStandard).ToString("0.00")}：";
            //左肩宽
            PublicSet.Myset.PJELeftShoulderSwitch = cbPJELeftShoulderSwitch.Checked;
            PublicSet.Myset.PJELeftShoulderStandard = Convert.ToDouble(tbPJELeftShoulderStandard.Text);
            PublicSet.Myset.PJELeftShoulderMax = Convert.ToDouble(tbPJELeftShoulderMax.Text);
            PublicSet.Myset.PJELeftShoulderMin = Convert.ToDouble(tbPJELeftShoulderMin.Text);
            PublicSet.Myset.PJELeftShoulderName = tbPJELeftShoulderName.Text;
            PublicSet.Cameraset.PJELeftShoulderCompensate = Convert.ToDouble(tbPJELeftShoulderCompensate.Text);
            PublicSet.Myset.PJELeftShoulderRange = $"{PublicSet.Myset.PJELeftShoulderStandard}±{(PublicSet.Myset.PJELeftShoulderMax - PublicSet.Myset.PJELeftShoulderStandard).ToString("0.00")}：";
            //右肩宽
            PublicSet.Myset.PJERightShoulderSwitch = cbPJERightShoulderSwitch.Checked;
            PublicSet.Myset.PJERightShoulderStandard = Convert.ToDouble(tbPJERightShoulderStandard.Text);
            PublicSet.Myset.PJERightShoulderMax = Convert.ToDouble(tbPJERightShoulderMax.Text);
            PublicSet.Myset.PJERightShoulderMin = Convert.ToDouble(tbPJERightShoulderMin.Text);
            PublicSet.Myset.PJERightShoulderName = tbPJERightShoulderName.Text;
            PublicSet.Cameraset.PJERightShoulderCompensate = Convert.ToDouble(tbPJERightShoulderCompensate.Text);
            PublicSet.Myset.PJERightShoulderRange = $"{PublicSet.Myset.PJERightShoulderStandard}±{(PublicSet.Myset.PJERightShoulderMax - PublicSet.Myset.PJERightShoulderStandard).ToString("0.00")}：";
            //极耳宽
            PublicSet.Myset.PJEWidthSwitch = cbPJEWidthSwitch.Checked;
            PublicSet.Myset.PJEWidthStandard = Convert.ToDouble(tbPJEWidthStandard.Text);
            PublicSet.Myset.PJEWidthMax = Convert.ToDouble(tbPJEWidthMax.Text);
            PublicSet.Myset.PJEWidthMin = Convert.ToDouble(tbPJEWidthMin.Text);
            PublicSet.Myset.PJEWidthName = tbPJEWidthName.Text;
            PublicSet.Cameraset.PJEWidthCompensate = Convert.ToDouble(tbPJEWidthCompensate.Text);
            PublicSet.Myset.PJEWidthRange = $"{PublicSet.Myset.PJEWidthStandard}±{(PublicSet.Myset.PJEWidthMax - PublicSet.Myset.PJEWidthStandard).ToString("0.00")}：";
            //极耳高
            PublicSet.Myset.PJEHeightSwitch = cbPJEHeightSwitch.Checked;
            PublicSet.Myset.PJEHeightStandard = Convert.ToDouble(tbPJEHeightStandard.Text);
            PublicSet.Myset.PJEHeightMax = Convert.ToDouble(tbPJEHeightMax.Text);
            PublicSet.Myset.PJEHeightMin = Convert.ToDouble(tbPJEHeightMin.Text);
            PublicSet.Myset.PJEHeightName = tbPJEHeightName.Text;
            PublicSet.Cameraset.PJEHeightCompensate = Convert.ToDouble(tbPJEHeightCompensate.Text);
            PublicSet.Myset.PJEHeightRange = $"{PublicSet.Myset.PJEHeightStandard}±{(PublicSet.Myset.PJEHeightMax - PublicSet.Myset.PJEHeightStandard).ToString("0.00")}：";
            //带料高
            PublicSet.Myset.PCeramicHeightSwitch = cbPCeramicHeightSwitch.Checked;
            PublicSet.Myset.PCeramicHeightStandard = Convert.ToDouble(tbPCeramicHeightStandard.Text);
            PublicSet.Myset.PCeramicHeightMax = Convert.ToDouble(tbPCeramicHeightMax.Text);
            PublicSet.Myset.PCeramicHeightMin = Convert.ToDouble(tbPCeramicHeightMin.Text);
            PublicSet.Myset.PCeramicHeightName = tbPCeramicHeightName.Text;
            PublicSet.Cameraset.PCeramicHeightCompensate = Convert.ToDouble(tbPCeramicHeightCompensate.Text);
            PublicSet.Myset.PCeramicHeightRange = $"{PublicSet.Myset.PCeramicHeightStandard}±{(PublicSet.Myset.PCeramicHeightMax - PublicSet.Myset.PCeramicHeightStandard).ToString("0.00")}：";
            //总宽
            PublicSet.Myset.PJPTotalWidthSwitch = cbPJPTotalWidthSwitch.Checked;
            PublicSet.Myset.PJPTotalWidthStandard = Convert.ToDouble(tbPJPTotalWidthStandard.Text);
            PublicSet.Myset.PJPTotalWidthMax = Convert.ToDouble(tbPJPTotalWidthMax.Text);
            PublicSet.Myset.PJPTotalWidthMin = Convert.ToDouble(tbPJPTotalWidthMin.Text);
            PublicSet.Myset.PJPTotalWidthName = tbPJPTotalWidthName.Text;
            PublicSet.Cameraset.PJPTotalWidthCompensate = Convert.ToDouble(tbPJPTotalWidthCompensate.Text);
            PublicSet.Myset.PJPTotalWidthRange = $"{PublicSet.Myset.PJPTotalWidthStandard}±{(PublicSet.Myset.PJPTotalWidthMax - PublicSet.Myset.PJPTotalWidthStandard).ToString("0.00")}：";
            //涂布高
            PublicSet.Myset.PJPCoatingSwitch = cbPJPCoatingSwitch.Checked;
            PublicSet.Myset.PJPCoatingStandard = Convert.ToDouble(tbPJPCoatingStandard.Text);
            PublicSet.Myset.PJPCoatingMax = Convert.ToDouble(tbPJPCoatingMax.Text);
            PublicSet.Myset.PJPCoatingMin = Convert.ToDouble(tbPJPCoatingMin.Text);
            PublicSet.Myset.PJPCoatingName = tbPJPCoatingName.Text;
            PublicSet.Cameraset.PJPCoatingCompensate = Convert.ToDouble(tbPJPCoatingCompensate.Text);
            PublicSet.Myset.PJPCoatingRange = $"{PublicSet.Myset.PJPCoatingStandard}±{(PublicSet.Myset.PJPCoatingMax - PublicSet.Myset.PJPCoatingStandard).ToString("0.00")}：";
            //对角线
            PublicSet.Myset.PDiagonalSwitch = cbPDiagonalSwitch.Checked;
            PublicSet.Myset.PDiagonalStandard = Convert.ToDouble(tbPDiagonalStandard.Text);
            PublicSet.Myset.PDiagonalMax = Convert.ToDouble(tbPDiagonalMax.Text);
            PublicSet.Myset.PDiagonalMin = Convert.ToDouble(tbPDiagonalMin.Text);
            PublicSet.Myset.PDiagonalName = tbPDiagonalName.Text;
            PublicSet.Cameraset.PDiagonalCompensate = Convert.ToDouble(tbPDiagonalCompensate.Text);
            PublicSet.Myset.PDiagonalRange = $"{PublicSet.Myset.PDiagonalStandard}±{(PublicSet.Myset.PDiagonalMax - PublicSet.Myset.PDiagonalStandard).ToString("0.00")}：";
            //左上垂直角度
            PublicSet.Myset.PLeftUpAngleSwitch = cbPLeftUpAngleSwitch.Checked;
            PublicSet.Myset.PLeftUpAngleStandard = Convert.ToDouble(tbPLeftUpAngleStandard.Text);
            PublicSet.Myset.PLeftUpAngleMax = Convert.ToDouble(tbPLeftUpAngleMax.Text);
            PublicSet.Myset.PLeftUpAngleMin = Convert.ToDouble(tbPLeftUpAngleMin.Text);
            PublicSet.Myset.PLeftUpAngleName = tbPLeftUpAngleName.Text;
            PublicSet.Cameraset.PLeftUpAngleCompensate = Convert.ToDouble(tbPLeftUpAngleCompensate.Text);
            PublicSet.Myset.PLeftUpAngleRange = $"{PublicSet.Myset.PLeftUpAngleStandard}±{(PublicSet.Myset.PLeftUpAngleMax - PublicSet.Myset.PLeftUpAngleStandard).ToString("0.00")}：";
            //右上垂直角度
            PublicSet.Myset.PRightUpAngleSwitch = cbPRightUpAngleSwitch.Checked;
            PublicSet.Myset.PRightUpAngleStandard = Convert.ToDouble(tbPRightUpAngleStandard.Text);
            PublicSet.Myset.PRightUpAngleMax = Convert.ToDouble(tbPRightUpAngleMax.Text);
            PublicSet.Myset.PRightUpAngleMin = Convert.ToDouble(tbPRightUpAngleMin.Text);
            PublicSet.Myset.PRightUpAngleName = tbPRightUpAngleName.Text;
            PublicSet.Cameraset.PRightUpAngleCompensate = Convert.ToDouble(tbPRightUpAngleCompensate.Text);
            PublicSet.Myset.PRightUpAngleRange = $"{PublicSet.Myset.PRightUpAngleStandard}±{(PublicSet.Myset.PRightUpAngleMax - PublicSet.Myset.PRightUpAngleStandard).ToString("0.00")}：";
            //左下垂直角度
            PublicSet.Myset.PLeftDownAngleSwitch = cbPLeftDownAngleSwitch.Checked;
            PublicSet.Myset.PLeftDownAngleStandard = Convert.ToDouble(tbPLeftDownAngleStandard.Text);
            PublicSet.Myset.PLeftDownAngleMax = Convert.ToDouble(tbPLeftDownAngleMax.Text);
            PublicSet.Myset.PLeftDownAngleMin = Convert.ToDouble(tbPLeftDownAngleMin.Text);
            PublicSet.Myset.PLeftDownAngleName = tbPLeftDownAngleName.Text;
            PublicSet.Cameraset.PLeftDownAngleCompensate = Convert.ToDouble(tbPLeftDownAngleCompensate.Text);
            PublicSet.Myset.PLeftDownAngleRange = $"{PublicSet.Myset.PLeftDownAngleStandard}±{(PublicSet.Myset.PLeftDownAngleMax - PublicSet.Myset.PLeftDownAngleStandard).ToString("0.00")}：";
            //右下垂直角度
            PublicSet.Myset.PRightDownAngleSwitch = cbPRightDownAngleSwitch.Checked;
            PublicSet.Myset.PRightDownAngleStandard = Convert.ToDouble(tbPRightDownAngleStandard.Text);
            PublicSet.Myset.PRightDownAngleMax = Convert.ToDouble(tbPRightDownAngleMax.Text);
            PublicSet.Myset.PRightDownAngleMin = Convert.ToDouble(tbPRightDownAngleMin.Text);
            PublicSet.Myset.PRightDownAngleName = tbPRightDownAngleName.Text;
            PublicSet.Cameraset.PRightDownAngleCompensate = Convert.ToDouble(tbPRightDownAngleCompensate.Text);
            PublicSet.Myset.PRightDownAngleRange = $"{PublicSet.Myset.PRightDownAngleStandard}±{(PublicSet.Myset.PRightDownAngleMax - PublicSet.Myset.PRightDownAngleStandard).ToString("0.00")}：";
            //mark点
            PublicSet.Myset.PMarkSwitch = cbPMarkSwitch.Checked;
            PublicSet.Myset.PMarkMin = Convert.ToDouble(tbPMarkMin.Text);
            PublicSet.Myset.PMarkMax = Convert.ToDouble(tbPMarkMax.Text);

            PublicSet.Myset.ChangeSet = true;
            Get_Bool(tab5);//正极工艺
            Get_Text(tab5);//正极工艺
            Get_Text(gbPCompensate);//负极工艺

        }
        /// <summary>
        /// 保存负极V角设置
        /// </summary>
        public void SaveNVCraft()
        {
            gbNArc.Visible = PublicSet.Myset.NOpenArcSwitch = cbNOpenArcSwitch.Checked;
            PublicSet.Myset.NLeftUpArcjdGray = Convert.ToDouble(tbNLeftUpArcjdGray.Text);
            PublicSet.Myset.NRightUpArcjdGray = Convert.ToDouble(tbNRightUpArcjdGray.Text);
            PublicSet.Myset.NLeftDownArcjdGray = Convert.ToDouble(tbNLeftDownArcjdGray.Text);
            PublicSet.Myset.NRightDownArcjdGray = Convert.ToDouble(tbNRightDownArcjdGray.Text);

            PublicSet.Myset.NLeftUpArcRad = Convert.ToDouble(tbNLeftUpArcRad.Text);
            PublicSet.Myset.NRightUpArcRad = Convert.ToDouble(tbNRightUpArcRad.Text);
            PublicSet.Myset.NLeftDownArcRad = Convert.ToDouble(tbNLeftDownArcRad.Text);
            PublicSet.Myset.NRightDownArcRad = Convert.ToDouble(tbNRightDownArcRad.Text);

            PublicSet.Myset.NLeftUpArcjdDit = Convert.ToDouble(tbNLeftUpArcjdDit.Text);
            PublicSet.Myset.NRightUpArcjdDit = Convert.ToDouble(tbNRightUpArcjdDit.Text);
            PublicSet.Myset.NLeftDownArcjdDit = Convert.ToDouble(tbNLeftDownArcjdDit.Text);
            PublicSet.Myset.NRightDownArcjdDit = Convert.ToDouble(tbNRightDownArcjdDit.Text);

            //左上
            PublicSet.Myset.NLeftUpVAngleSwitch = cbNLeftUpVAngleSwitch.Checked;
            PublicSet.Myset.NLeftUpVAngleMin = Convert.ToDouble(tbNLeftUpVAngleMin.Text);
            PublicSet.Myset.NLeftUpVAngleMax = Convert.ToDouble(tbNLeftUpVAngleMax.Text);
            PublicSet.Myset.NLeftUpVAngleStandard = Convert.ToDouble(tbNLeftUpVAngleStandard.Text);
            PublicSet.Myset.NLeftUpVAngleName = tbNLeftUpVAngleName.Text;
            PublicSet.Cameraset.NLeftUpVAngleCompensate = Convert.ToDouble(tbNLeftUpVAngleCompensate.Text);
            PublicSet.Myset.NLeftUpVAngleRange = $"{PublicSet.Myset.NLeftUpVAngleStandard}±{(PublicSet.Myset.NLeftUpVAngleMax - PublicSet.Myset.NLeftUpVAngleStandard).ToString("0.00")}：";


            PublicSet.Myset.NLeftUpVWidthSwitch = cbNLeftUpVWidthSwitch.Checked;
            PublicSet.Myset.NLeftUpVWidthMin = Convert.ToDouble(tbNLeftUpVWidthMin.Text);
            PublicSet.Myset.NLeftUpVWidthMax = Convert.ToDouble(tbNLeftUpVWidthMax.Text);
            PublicSet.Myset.NLeftUpVWidthStandard = Convert.ToDouble(tbNLeftUpVWidthStandard.Text);
            PublicSet.Myset.NLeftUpVWidthName = tbNLeftUpVWidthName.Text;
            PublicSet.Cameraset.NLeftUpVWidthCompensate = Convert.ToDouble(tbNLeftUpVWidthCompensate.Text);
            PublicSet.Myset.NLeftUpVWidthRange = $"{PublicSet.Myset.NLeftUpVWidthStandard}±{(PublicSet.Myset.NLeftUpVWidthMax - PublicSet.Myset.NLeftUpVWidthStandard).ToString("0.00")}：";

            PublicSet.Myset.NLeftUpVDepthSwitch = cbNLeftUpVDepthSwitch.Checked;
            PublicSet.Myset.NLeftUpVDepthMin = Convert.ToDouble(tbNLeftUpVDepthMin.Text);
            PublicSet.Myset.NLeftUpVDepthMax = Convert.ToDouble(tbNLeftUpVDepthMax.Text);
            PublicSet.Myset.NLeftUpVDepthStandard = Convert.ToDouble(tbNLeftUpVDepthStandard.Text);
            PublicSet.Myset.NLeftUpVDepthName = tbNLeftUpVDepthName.Text;
            PublicSet.Cameraset.NLeftUpVDepthCompensate = Convert.ToDouble(tbNLeftUpVDepthCompensate.Text);
            PublicSet.Myset.NLeftUpVDepthRange = $"{PublicSet.Myset.NLeftUpVDepthStandard}±{(PublicSet.Myset.NLeftUpVDepthMax - PublicSet.Myset.NLeftUpVDepthStandard).ToString("0.00")}：";

            //右上
            PublicSet.Myset.NRightUpVAngleSwitch = cbNRightUpVAngleSwitch.Checked;
            PublicSet.Myset.NRightUpVAngleMin = Convert.ToDouble(tbNRightUpVAngleMin.Text);
            PublicSet.Myset.NRightUpVAngleMax = Convert.ToDouble(tbNRightUpVAngleMax.Text);
            PublicSet.Myset.NRightUpVAngleStandard = Convert.ToDouble(tbNRightUpVAngleStandard.Text);
            PublicSet.Myset.NRightUpVAngleName = tbNRightUpVAngleName.Text;
            PublicSet.Cameraset.NRightUpVAngleCompensate = Convert.ToDouble(tbNRightUpVAngleCompensate.Text);
            PublicSet.Myset.NRightUpVAngleRange = $"{PublicSet.Myset.NRightUpVAngleStandard}±{(PublicSet.Myset.NRightUpVAngleMax - PublicSet.Myset.NRightUpVAngleStandard).ToString("0.00")}：";

            PublicSet.Myset.NRightUpVWidthSwitch = cbNRightUpVWidthSwitch.Checked;
            PublicSet.Myset.NRightUpVWidthMin = Convert.ToDouble(tbNRightUpVWidthMin.Text);
            PublicSet.Myset.NRightUpVWidthMax = Convert.ToDouble(tbNRightUpVWidthMax.Text);
            PublicSet.Myset.NRightUpVWidthStandard = Convert.ToDouble(tbNRightUpVWidthStandard.Text);
            PublicSet.Myset.NRightUpVWidthName = tbNRightUpVWidthName.Text;
            PublicSet.Cameraset.NRightUpVWidthCompensate = Convert.ToDouble(tbNRightUpVWidthCompensate.Text);
            PublicSet.Myset.NRightUpVWidthRange = $"{PublicSet.Myset.NRightUpVWidthStandard}±{(PublicSet.Myset.NRightUpVWidthMax - PublicSet.Myset.NRightUpVWidthStandard).ToString("0.00")}：";

            PublicSet.Myset.NRightUpVDepthSwitch = cbNRightUpVDepthSwitch.Checked;
            PublicSet.Myset.NRightUpVDepthMin = Convert.ToDouble(tbNRightUpVDepthMin.Text);
            PublicSet.Myset.NRightUpVDepthMax = Convert.ToDouble(tbNRightUpVDepthMax.Text);
            PublicSet.Myset.NRightUpVDepthStandard = Convert.ToDouble(tbNRightUpVDepthStandard.Text);
            PublicSet.Myset.NRightUpVDepthName = tbNRightUpVDepthName.Text;
            PublicSet.Cameraset.NRightUpVDepthCompensate = Convert.ToDouble(tbNRightUpVDepthCompensate.Text);
            PublicSet.Myset.NRightUpVDepthRange = $"{PublicSet.Myset.NRightUpVDepthStandard}±{(PublicSet.Myset.NRightUpVDepthMax - PublicSet.Myset.NRightUpVDepthStandard).ToString("0.00")}：";

            //左下
            PublicSet.Myset.NLeftDownVAngleSwitch = cbNLeftDownVAngleSwitch.Checked;
            PublicSet.Myset.NLeftDownVAngleMin = Convert.ToDouble(tbNLeftDownVAngleMin.Text);
            PublicSet.Myset.NLeftDownVAngleMax = Convert.ToDouble(tbNLeftDownVAngleMax.Text);
            PublicSet.Myset.NLeftDownVAngleStandard = Convert.ToDouble(tbNLeftDownVAngleStandard.Text);
            PublicSet.Myset.NLeftDownVAngleName = tbNLeftDownVAngleName.Text;
            PublicSet.Cameraset.NLeftDownVAngleCompensate = Convert.ToDouble(tbNLeftDownVAngleCompensate.Text);
            PublicSet.Myset.NLeftDownVAngleRange = $"{PublicSet.Myset.NLeftDownVAngleStandard}±{(PublicSet.Myset.NLeftDownVAngleMax - PublicSet.Myset.NLeftDownVAngleStandard).ToString("0.00")}：";

            PublicSet.Myset.NLeftDownVWidthSwitch = cbNLeftDownVWidthSwitch.Checked;
            PublicSet.Myset.NLeftDownVWidthMin = Convert.ToDouble(tbNLeftDownVWidthMin.Text);
            PublicSet.Myset.NLeftDownVWidthMax = Convert.ToDouble(tbNLeftDownVWidthMax.Text);
            PublicSet.Myset.NLeftDownVWidthStandard = Convert.ToDouble(tbNLeftDownVWidthStandard.Text);
            PublicSet.Myset.NLeftDownVWidthName = tbNLeftDownVWidthName.Text;
            PublicSet.Cameraset.NLeftDownVWidthCompensate = Convert.ToDouble(tbNLeftDownVWidthCompensate.Text);
            PublicSet.Myset.NLeftDownVWidthRange = $"{PublicSet.Myset.NLeftDownVWidthStandard}±{(PublicSet.Myset.NLeftDownVWidthMax - PublicSet.Myset.NLeftDownVWidthStandard).ToString("0.00")}：";

            PublicSet.Myset.NLeftDownVDepthSwitch = cbNLeftDownVDepthSwitch.Checked;
            PublicSet.Myset.NLeftDownVDepthMin = Convert.ToDouble(tbNLeftDownVDepthMin.Text);
            PublicSet.Myset.NLeftDownVDepthMax = Convert.ToDouble(tbNLeftDownVDepthMax.Text);
            PublicSet.Myset.NLeftDownVDepthStandard = Convert.ToDouble(tbNLeftDownVDepthStandard.Text);
            PublicSet.Myset.NLeftDownVDepthName = tbNLeftDownVDepthName.Text;
            PublicSet.Cameraset.NLeftDownVDepthCompensate = Convert.ToDouble(tbNLeftDownVDepthCompensate.Text);
            PublicSet.Myset.NLeftDownVDepthRange = $"{PublicSet.Myset.NLeftDownVDepthStandard}±{(PublicSet.Myset.NLeftDownVDepthMax - PublicSet.Myset.NLeftDownVDepthStandard).ToString("0.00")}：";
            //右下
            PublicSet.Myset.NRightDownVAngleSwitch = cbNRightDownVAngleSwitch.Checked;
            PublicSet.Myset.NRightDownVAngleMin = Convert.ToDouble(tbNRightDownVAngleMin.Text);
            PublicSet.Myset.NRightDownVAngleMax = Convert.ToDouble(tbNRightDownVAngleMax.Text);
            PublicSet.Myset.NRightDownVAngleStandard = Convert.ToDouble(tbNRightDownVAngleStandard.Text);
            PublicSet.Myset.NRightDownVAngleName = tbNRightDownVAngleName.Text;
            PublicSet.Cameraset.NRightDownVAngleCompensate = Convert.ToDouble(tbNRightDownVAngleCompensate.Text);
            PublicSet.Myset.NRightDownVAngleRange = $"{PublicSet.Myset.NRightDownVAngleStandard}±{(PublicSet.Myset.NRightDownVAngleMax - PublicSet.Myset.NRightDownVAngleStandard).ToString("0.00")}：";

            PublicSet.Myset.NRightDownVWidthSwitch = cbNRightDownVWidthSwitch.Checked;
            PublicSet.Myset.NRightDownVWidthMin = Convert.ToDouble(tbNRightDownVWidthMin.Text);
            PublicSet.Myset.NRightDownVWidthMax = Convert.ToDouble(tbNRightDownVWidthMax.Text);
            PublicSet.Myset.NRightDownVWidthStandard = Convert.ToDouble(tbNRightDownVWidthStandard.Text);
            PublicSet.Myset.NRightDownVWidthName = tbNRightDownVWidthName.Text;
            PublicSet.Cameraset.NRightDownVWidthCompensate = Convert.ToDouble(tbNRightDownVWidthCompensate.Text);
            PublicSet.Myset.NRightDownVWidthRange = $"{PublicSet.Myset.NRightDownVWidthStandard}±{(PublicSet.Myset.NRightDownVWidthMax - PublicSet.Myset.NRightDownVWidthStandard).ToString("0.00")}：";

            PublicSet.Myset.NRightDownVDepthSwitch = cbNRightDownVDepthSwitch.Checked;
            PublicSet.Myset.NRightDownVDepthMin = Convert.ToDouble(tbNRightDownVDepthMin.Text);
            PublicSet.Myset.NRightDownVDepthMax = Convert.ToDouble(tbNRightDownVDepthMax.Text);
            PublicSet.Myset.NRightDownVDepthStandard = Convert.ToDouble(tbNRightDownVDepthStandard.Text);
            PublicSet.Myset.NRightDownVDepthName = tbNRightDownVDepthName.Text;
            PublicSet.Cameraset.NRightDownVDepthCompensate = Convert.ToDouble(tbNRightDownVDepthCompensate.Text);
            PublicSet.Myset.NRightDownVDepthRange = $"{PublicSet.Myset.NRightDownVDepthStandard}±{(PublicSet.Myset.NRightDownVDepthMax - PublicSet.Myset.NRightDownVDepthStandard).ToString("0.00")}：";
            PublicSet.Myset.ChangeSet = true;
            Get_Bool(tab4);//负极V工艺
            Get_Text(tab4);//负极V工艺
            Get_Text(gbNVCompensate);//负极V工艺

        }
        /// <summary>
        /// 保存正极V角设置
        /// </summary>
        public void SavePVCraft()
        {
            gbPArc.Visible = PublicSet.Myset.POpenArcSwitch = cbPOpenArcSwitch.Checked;
            PublicSet.Myset.PLeftUpArcjdGray = Convert.ToDouble(tbPLeftUpArcjdGray.Text);
            PublicSet.Myset.PRightUpArcjdGray = Convert.ToDouble(tbPRightUpArcjdGray.Text);
            PublicSet.Myset.PLeftDownArcjdGray = Convert.ToDouble(tbPLeftDownArcjdGray.Text);
            PublicSet.Myset.PRightDownArcjdGray = Convert.ToDouble(tbPRightDownArcjdGray.Text);

            PublicSet.Myset.PLeftUpArcRad = Convert.ToDouble(tbPLeftUpArcRad.Text);
            PublicSet.Myset.PRightUpArcRad = Convert.ToDouble(tbPRightUpArcRad.Text);
            PublicSet.Myset.PLeftDownArcRad = Convert.ToDouble(tbPLeftDownArcRad.Text);
            PublicSet.Myset.PRightDownArcRad = Convert.ToDouble(tbPRightDownArcRad.Text);

            PublicSet.Myset.PLeftUpArcjdDit = Convert.ToDouble(tbPLeftUpArcjdDit.Text);
            PublicSet.Myset.PRightUpArcjdDit = Convert.ToDouble(tbPRightUpArcjdDit.Text);
            PublicSet.Myset.PLeftDownArcjdDit = Convert.ToDouble(tbPLeftDownArcjdDit.Text);
            PublicSet.Myset.PRightDownArcjdDit = Convert.ToDouble(tbPRightDownArcjdDit.Text);

            //左上
            PublicSet.Myset.PLeftUpVAngleSwitch = cbPLeftUpVAngleSwitch.Checked;
            PublicSet.Myset.PLeftUpVAngleMin = Convert.ToDouble(tbPLeftUpVAngleMin.Text);
            PublicSet.Myset.PLeftUpVAngleMax = Convert.ToDouble(tbPLeftUpVAngleMax.Text);
            PublicSet.Myset.PLeftUpVAngleStandard = Convert.ToDouble(tbPLeftUpVAngleStandard.Text);
            PublicSet.Myset.PLeftUpVAngleName = tbPLeftUpVAngleName.Text;
            PublicSet.Cameraset.PLeftUpVAngleCompensate = Convert.ToDouble(tbPLeftUpVAngleCompensate.Text);
            PublicSet.Myset.PLeftUpVAngleRange = $"{PublicSet.Myset.PLeftUpVAngleStandard}±{(PublicSet.Myset.PLeftUpVAngleMax - PublicSet.Myset.PLeftUpVAngleStandard).ToString("0.00")} ：";

            PublicSet.Myset.PLeftUpVWidthSwitch = cbPLeftUpVWidthSwitch.Checked;
            PublicSet.Myset.PLeftUpVWidthMin = Convert.ToDouble(tbPLeftUpVWidthMin.Text);
            PublicSet.Myset.PLeftUpVWidthMax = Convert.ToDouble(tbPLeftUpVWidthMax.Text);
            PublicSet.Myset.PLeftUpVWidthStandard = Convert.ToDouble(tbPLeftUpVWidthStandard.Text);
            PublicSet.Myset.PLeftUpVWidthName = tbPLeftUpVWidthName.Text;
            PublicSet.Cameraset.PLeftUpVWidthCompensate = Convert.ToDouble(tbPLeftUpVWidthCompensate.Text);
            PublicSet.Myset.PLeftUpVWidthRange = $"{PublicSet.Myset.PLeftUpVWidthStandard} ±{(PublicSet.Myset.PLeftUpVWidthMax - PublicSet.Myset.PLeftUpVWidthStandard).ToString("0.00")} ：";

            PublicSet.Myset.PLeftUpVDepthSwitch = cbPLeftUpVDepthSwitch.Checked;
            PublicSet.Myset.PLeftUpVDepthMin = Convert.ToDouble(tbPLeftUpVDepthMin.Text);
            PublicSet.Myset.PLeftUpVDepthMax = Convert.ToDouble(tbPLeftUpVDepthMax.Text);
            PublicSet.Myset.PLeftUpVDepthStandard = Convert.ToDouble(tbPLeftUpVDepthStandard.Text);
            PublicSet.Myset.PLeftUpVDepthName = tbPLeftUpVDepthName.Text;
            PublicSet.Cameraset.PLeftUpVDepthCompensate = Convert.ToDouble(tbPLeftUpVDepthCompensate.Text);
            PublicSet.Myset.PLeftUpVDepthRange = $"{PublicSet.Myset.PLeftUpVDepthStandard} ±{(PublicSet.Myset.PLeftUpVDepthMax - PublicSet.Myset.PLeftUpVDepthStandard).ToString("0.00")}：";

            //右上
            PublicSet.Myset.PRightUpVAngleSwitch = cbPRightUpVAngleSwitch.Checked;
            PublicSet.Myset.PRightUpVAngleMin = Convert.ToDouble(tbPRightUpVAngleMin.Text);
            PublicSet.Myset.PRightUpVAngleMax = Convert.ToDouble(tbPRightUpVAngleMax.Text);
            PublicSet.Myset.PRightUpVAngleStandard = Convert.ToDouble(tbPRightUpVAngleStandard.Text);
            PublicSet.Myset.PRightUpVAngleName = tbPRightUpVAngleName.Text;
            PublicSet.Cameraset.PRightUpVAngleCompensate = Convert.ToDouble(tbPRightUpVAngleCompensate.Text);
            PublicSet.Myset.PRightUpVAngleRange = $"{PublicSet.Myset.PRightUpVAngleStandard}±{(PublicSet.Myset.PRightUpVAngleMax - PublicSet.Myset.PRightUpVAngleStandard).ToString("0.00")}：";

            PublicSet.Myset.PRightUpVWidthSwitch = cbPRightUpVWidthSwitch.Checked;
            PublicSet.Myset.PRightUpVWidthMin = Convert.ToDouble(tbPRightUpVWidthMin.Text);
            PublicSet.Myset.PRightUpVWidthMax = Convert.ToDouble(tbPRightUpVWidthMax.Text);
            PublicSet.Myset.PRightUpVWidthStandard = Convert.ToDouble(tbPRightUpVWidthStandard.Text);
            PublicSet.Myset.PRightUpVWidthName = tbPRightUpVWidthName.Text;
            PublicSet.Cameraset.PRightUpVWidthCompensate = Convert.ToDouble(tbPRightUpVWidthCompensate.Text);
            PublicSet.Myset.PRightUpVWidthRange = $"{PublicSet.Myset.PRightUpVWidthStandard} ±{(PublicSet.Myset.PRightUpVWidthMax - PublicSet.Myset.PRightUpVWidthStandard).ToString("0.00")}：";

            PublicSet.Myset.PRightUpVDepthSwitch = cbPRightUpVDepthSwitch.Checked;
            PublicSet.Myset.PRightUpVDepthMin = Convert.ToDouble(tbPRightUpVDepthMin.Text);
            PublicSet.Myset.PRightUpVDepthMax = Convert.ToDouble(tbPRightUpVDepthMax.Text);
            PublicSet.Myset.PRightUpVDepthStandard = Convert.ToDouble(tbPRightUpVDepthStandard.Text);
            PublicSet.Myset.PRightUpVDepthName = tbPRightUpVDepthName.Text;
            PublicSet.Cameraset.PRightUpVDepthCompensate = Convert.ToDouble(tbPRightUpVDepthCompensate.Text);
            PublicSet.Myset.PRightUpVDepthRange = $"{PublicSet.Myset.PRightUpVDepthStandard} ±{(PublicSet.Myset.PRightUpVDepthMax - PublicSet.Myset.PRightUpVDepthStandard).ToString("0.00")}";
            //左下
            PublicSet.Myset.PLeftDownVAngleSwitch = cbPLeftDownVAngleSwitch.Checked;
            PublicSet.Myset.PLeftDownVAngleMin = Convert.ToDouble(tbPLeftDownVAngleMin.Text);
            PublicSet.Myset.PLeftDownVAngleMax = Convert.ToDouble(tbPLeftDownVAngleMax.Text);
            PublicSet.Myset.PLeftDownVAngleStandard = Convert.ToDouble(tbPLeftDownVAngleStandard.Text);
            PublicSet.Myset.PLeftDownVAngleName = tbPLeftDownVAngleName.Text;
            PublicSet.Cameraset.PLeftDownVAngleCompensate = Convert.ToDouble(tbPLeftDownVAngleCompensate.Text);
            PublicSet.Myset.PLeftDownVAngleRange = $"{PublicSet.Myset.PLeftDownVAngleStandard}±{(PublicSet.Myset.PLeftDownVAngleMax - PublicSet.Myset.PLeftDownVAngleStandard).ToString("0.00")}：";

            PublicSet.Myset.PLeftDownVWidthSwitch = cbPLeftDownVWidthSwitch.Checked;
            PublicSet.Myset.PLeftDownVWidthMin = Convert.ToDouble(tbPLeftDownVWidthMin.Text);
            PublicSet.Myset.PLeftDownVWidthMax = Convert.ToDouble(tbPLeftDownVWidthMax.Text);
            PublicSet.Myset.PLeftDownVWidthStandard = Convert.ToDouble(tbPLeftDownVWidthStandard.Text);
            PublicSet.Myset.PLeftDownVWidthName = tbPLeftDownVWidthName.Text;
            PublicSet.Cameraset.PLeftDownVWidthCompensate = Convert.ToDouble(tbPLeftDownVWidthCompensate.Text);
            PublicSet.Myset.PLeftDownVWidthRange = $"{PublicSet.Myset.PLeftDownVWidthStandard}±{(PublicSet.Myset.PLeftDownVWidthMax - PublicSet.Myset.PLeftDownVWidthStandard).ToString("0.00")}：";

            PublicSet.Myset.PLeftDownVDepthSwitch = cbPLeftDownVDepthSwitch.Checked;
            PublicSet.Myset.PLeftDownVDepthMin = Convert.ToDouble(tbPLeftDownVDepthMin.Text);
            PublicSet.Myset.PLeftDownVDepthMax = Convert.ToDouble(tbPLeftDownVDepthMax.Text);
            PublicSet.Myset.PLeftDownVDepthStandard = Convert.ToDouble(tbPLeftDownVDepthStandard.Text);
            PublicSet.Myset.PLeftDownVDepthName = tbPLeftDownVDepthName.Text;
            PublicSet.Cameraset.PLeftDownVDepthCompensate = Convert.ToDouble(tbPLeftDownVDepthCompensate.Text);
            PublicSet.Myset.PLeftDownVDepthRange = $"{PublicSet.Myset.PLeftDownVDepthStandard}±{(PublicSet.Myset.PLeftDownVDepthMax - PublicSet.Myset.PLeftDownVDepthStandard).ToString("0.00")}：";

            //右下
            PublicSet.Myset.PRightDownVAngleSwitch = cbPRightDownVAngleSwitch.Checked;
            PublicSet.Myset.PRightDownVAngleMin = Convert.ToDouble(tbPRightDownVAngleMin.Text);
            PublicSet.Myset.PRightDownVAngleMax = Convert.ToDouble(tbPRightDownVAngleMax.Text);
            PublicSet.Myset.PRightDownVAngleStandard = Convert.ToDouble(tbPRightDownVAngleStandard.Text);
            PublicSet.Myset.PRightDownVAngleName = tbPRightDownVAngleName.Text;
            PublicSet.Cameraset.PRightDownVAngleCompensate = Convert.ToDouble(tbPRightDownVAngleCompensate.Text);
            PublicSet.Myset.PRightDownVAngleRange = $"{PublicSet.Myset.PRightDownVAngleStandard}±{(PublicSet.Myset.PRightDownVAngleMax - PublicSet.Myset.PRightDownVAngleStandard).ToString("0.00")}：";

            PublicSet.Myset.PRightDownVWidthSwitch = cbPRightDownVWidthSwitch.Checked;
            PublicSet.Myset.PRightDownVWidthMin = Convert.ToDouble(tbPRightDownVWidthMin.Text);
            PublicSet.Myset.PRightDownVWidthMax = Convert.ToDouble(tbPRightDownVWidthMax.Text);
            PublicSet.Myset.PRightDownVWidthStandard = Convert.ToDouble(tbPRightDownVWidthStandard.Text);
            PublicSet.Myset.PRightDownVWidthName = tbPRightDownVWidthName.Text;
            PublicSet.Cameraset.PRightDownVWidthCompensate = Convert.ToDouble(tbPRightDownVWidthCompensate.Text);
            PublicSet.Myset.PRightDownVWidthRange = $"{PublicSet.Myset.PRightDownVWidthStandard}±{(PublicSet.Myset.PRightDownVWidthMax - PublicSet.Myset.PRightDownVWidthStandard).ToString("0.00")}：";

            PublicSet.Myset.PRightDownVDepthSwitch = cbPRightDownVDepthSwitch.Checked;
            PublicSet.Myset.PRightDownVDepthMin = Convert.ToDouble(tbPRightDownVDepthMin.Text);
            PublicSet.Myset.PRightDownVDepthMax = Convert.ToDouble(tbPRightDownVDepthMax.Text);
            PublicSet.Myset.PRightDownVDepthStandard = Convert.ToDouble(tbPRightDownVDepthStandard.Text);
            PublicSet.Myset.PRightDownVDepthName = tbPRightDownVDepthName.Text;
            PublicSet.Cameraset.PRightDownVDepthCompensate = Convert.ToDouble(tbPRightDownVDepthCompensate.Text);
            PublicSet.Myset.PRightDownVDepthRange = $"{PublicSet.Myset.PRightDownVDepthStandard}±{(PublicSet.Myset.PRightDownVDepthMax - PublicSet.Myset.PRightDownVDepthStandard).ToString("0.00")}：";
            PublicSet.Myset.ChangeSet = true;
            Get_Bool(tab6);//正极V工艺
            Get_Text(tab6);//正极V工艺
            Get_Text(gbPVCompensate);//正极V工艺
        }

        /// <summary>
        /// 保存极耳打折   
        /// </summary>
        public void SaveBevelLimit()
        {
            //负极
            PublicSet.Myset.NJEBevelLimitSwitch = cbNJEBevelLimitSwitch.Checked;

            PublicSet.Myset.NJEGrayMin = Convert.ToInt32(tbNJEGrayMin.Text);
            PublicSet.Myset.NJEGrayMax = Convert.ToInt32(tbNJEGrayMax.Text);
            PublicSet.Myset.NJEAreaStandard = Convert.ToDouble(tbNJEAreaStandard.Text);
            PublicSet.Myset.NJEAreaRange = Convert.ToDouble(tbNJEAreaRange.Text);
            PublicSet.Myset.NJeOddmentsArea = Convert.ToDouble(tbNJeOddmentsArea.Text);

            PublicSet.Myset.NJEColumnErosion = Math.Round(double.Parse(tbNJEColumnErosion.Text), 1);//内缩只能保留一位小数
            PublicSet.Myset.NJERowErosion = Math.Round(double.Parse(tbNJERowErosion.Text), 1);
            tbNJEColumnErosion.Text = PublicSet.Myset.NJEColumnErosion.ToString();//重新给内缩控件赋值，当输入多位小数时更新为只有1位小数
            tbNJERowErosion.Text = PublicSet.Myset.NJERowErosion.ToString();

            PublicSet.Myset.NJERectangularity = Convert.ToDouble(tbNJERectangularity.Text);
            PublicSet.Myset.NJEGapGrayMin = Convert.ToDouble(tbNJEGapGrayMin.Text);
            PublicSet.Myset.NJEGapGrayMax = Convert.ToDouble(tbNJEGapGrayMax.Text);
            PublicSet.Myset.NJEGapAreaMax = Convert.ToDouble(tbNJEGapAreaMax.Text);
            PublicSet.Myset.NJEHeight = Convert.ToDouble(tbNJEHeight.Text);
            PublicSet.Myset.NJEWidth = Convert.ToDouble(tbNJEWidth.Text);
            PublicSet.Myset.NJEHeight1 = Convert.ToDouble(tbNJEHeight1.Text);
            PublicSet.Myset.NJEWidth1 = Convert.ToDouble(tbNJEWidth1.Text);
            PublicSet.Myset.NArcAreaMax_Up = Convert.ToDouble(tbNArcAreaMax_Up.Text);
            PublicSet.Myset.NArcAreaMax_Down = Convert.ToDouble(tbNArcAreaMax_Down.Text);
            PublicSet.Myset.NArcAreaMin_Down = Convert.ToDouble(tbNArcAreaMin_Down.Text);
            PublicSet.Myset.NArcGrayMin_Up = Convert.ToDouble(tbNArcGrayMin_Up.Text);

            //正极
            PublicSet.Myset.PJEBevelLimitSwitch = cbPJEBevelLimitSwitch.Checked;

            PublicSet.Myset.PJEGrayMin = Convert.ToInt32(tbPJEGrayMin.Text);
            PublicSet.Myset.PJEGrayMax = Convert.ToInt32(tbPJEGrayMax.Text);
            PublicSet.Myset.PJEAreaStandard = Convert.ToDouble(tbPJEAreaStandard.Text);
            PublicSet.Myset.PJEAreaRange = Convert.ToDouble(tbPJEAreaRange.Text);
            PublicSet.Myset.PJeOddmentsArea = Convert.ToDouble(tbPJeOddmentsArea.Text);

            PublicSet.Myset.PJEColumnErosion = Math.Round(double.Parse(tbPJEColumnErosion.Text), 1);
            PublicSet.Myset.PJERowErosion = Math.Round(double.Parse(tbPJERowErosion.Text), 1);
            tbPJEColumnErosion.Text = PublicSet.Myset.PJEColumnErosion.ToString();//重新给内缩控件赋值，当输入多位小数时更新为只有1位小数
            tbPJERowErosion.Text = PublicSet.Myset.PJERowErosion.ToString();

            PublicSet.Myset.PJERectangularity = Convert.ToDouble(tbPJERectangularity.Text);
            PublicSet.Myset.PJEGapGrayMin = Convert.ToDouble(tbPJEGapGrayMin.Text);
            PublicSet.Myset.PJEGapGrayMax = Convert.ToDouble(tbPJEGapGrayMax.Text);
            PublicSet.Myset.PJEGapAreaMax = Convert.ToDouble(tbPJEGapAreaMax.Text);
            PublicSet.Myset.PJEHeight = Convert.ToDouble(tbPJEHeight.Text);
            PublicSet.Myset.PJEWidth = Convert.ToDouble(tbPJEWidth.Text);
            PublicSet.Myset.PJEHeight1 = Convert.ToDouble(tbPJEHeight1.Text);
            PublicSet.Myset.PJEWidth1 = Convert.ToDouble(tbPJEWidth1.Text);
            PublicSet.Myset.PArcAreaMax_Up = Convert.ToDouble(tbPArcAreaMax_Up.Text);
            PublicSet.Myset.PArcAreaMax_Down = Convert.ToDouble(tbPArcAreaMax_Down.Text);
            PublicSet.Myset.PArcAreaMin_Down = Convert.ToDouble(tbPArcAreaMin_Down.Text);
            PublicSet.Myset.PArcGrayMin_Up = Convert.ToDouble(tbPArcGrayMin_Up.Text);
            PublicSet.Myset.ChangeSet = true;
            Get_Bool(groupBox22);//极耳打折
            Get_Text(groupBox22);//极耳打折
            Get_Bool(groupBox15);//极耳打折
            Get_Text(groupBox15);//极耳打折


        }
        /// <summary>
        /// 保存极耳打折 -极耳双相机时使用  
        /// </summary>
        public void SaveBevelLimit_Two()
        {
            //负极
            PublicSet.Myset.NJEBevelLimitSwitch1 = cbNJEBevelLimitSwitch1.Checked;

            PublicSet.Myset.NJEGrayMin1 = Convert.ToInt32(tbNJEGrayMin1.Text);
            PublicSet.Myset.NJEGrayMax1 = Convert.ToInt32(tbNJEGrayMax1.Text);
            PublicSet.Myset.NJEAreaStandard1 = Convert.ToDouble(tbNJEAreaStandard1.Text);
            PublicSet.Myset.NJEAreaRange1 = Convert.ToDouble(tbNJEAreaRange1.Text);
            PublicSet.Myset.NJeOddmentsArea1 = Convert.ToDouble(tbNJeOddmentsArea1.Text);

            PublicSet.Myset.NJEColumnErosion1 = Math.Round(double.Parse(tbNJEColumnErosion1.Text), 1);//内缩只能保留一位小数
            PublicSet.Myset.NJERowErosion1 = Math.Round(double.Parse(tbNJERowErosion1.Text), 1);
            tbNJEColumnErosion1.Text = PublicSet.Myset.NJEColumnErosion1.ToString();//重新给内缩控件赋值，当输入多位小数时更新为只有1位小数
            tbNJERowErosion1.Text = PublicSet.Myset.NJERowErosion1.ToString();

            PublicSet.Myset.NJERectangularity1 = Convert.ToDouble(tbNJERectangularity1.Text);
            PublicSet.Myset.NJEGapGrayMin1 = Convert.ToDouble(tbNJEGapGrayMin1.Text);
            PublicSet.Myset.NJEGapGrayMax1 = Convert.ToDouble(tbNJEGapGrayMax1.Text);
            PublicSet.Myset.NJEGapAreaMax1 = Convert.ToDouble(tbNJEGapAreaMax1.Text);

            PublicSet.Myset.NJEHeight1 = Convert.ToDouble(tbNJEHeight1.Text);
            PublicSet.Myset.NJEWidth1 = Convert.ToDouble(tbNJEWidth1.Text);
            PublicSet.Myset.NArcAreaMax_Up1 = Convert.ToDouble(tbNArcAreaMax_Up1.Text);
            PublicSet.Myset.NArcAreaMax_Down1 = Convert.ToDouble(tbNArcAreaMax_Down1.Text);
            PublicSet.Myset.NArcAreaMin_Down1 = Convert.ToDouble(tbNArcAreaMin_Down1.Text);
            PublicSet.Myset.NArcGrayMin_Up1 = Convert.ToDouble(tbNArcGrayMin_Up1.Text);

            //正极
            PublicSet.Myset.PJEBevelLimitSwitch1 = cbPJEBevelLimitSwitch1.Checked;

            PublicSet.Myset.PJEGrayMin1 = Convert.ToInt32(tbPJEGrayMin1.Text);
            PublicSet.Myset.PJEGrayMax1 = Convert.ToInt32(tbPJEGrayMax1.Text);
            PublicSet.Myset.PJEAreaStandard1 = Convert.ToDouble(tbPJEAreaStandard1.Text);
            PublicSet.Myset.PJEAreaRange1 = Convert.ToDouble(tbPJEAreaRange1.Text);
            PublicSet.Myset.PJeOddmentsArea1 = Convert.ToDouble(tbPJeOddmentsArea1.Text);

            PublicSet.Myset.PJEColumnErosion1 = Math.Round(double.Parse(tbPJEColumnErosion1.Text), 1);
            PublicSet.Myset.PJERowErosion1 = Math.Round(double.Parse(tbPJERowErosion1.Text), 1);
            tbPJEColumnErosion1.Text = PublicSet.Myset.PJEColumnErosion1.ToString();//重新给内缩控件赋值，当输入多位小数时更新为只有1位小数
            tbPJERowErosion1.Text = PublicSet.Myset.PJERowErosion1.ToString();

            PublicSet.Myset.PJERectangularity1 = Convert.ToDouble(tbPJERectangularity1.Text);
            PublicSet.Myset.PJEGapGrayMin1 = Convert.ToDouble(tbPJEGapGrayMin1.Text);
            PublicSet.Myset.PJEGapGrayMax1 = Convert.ToDouble(tbPJEGapGrayMax1.Text);
            PublicSet.Myset.PJEGapAreaMax1 = Convert.ToDouble(tbPJEGapAreaMax1.Text);

            PublicSet.Myset.PJEHeight1 = Convert.ToDouble(tbPJEHeight1.Text);
            PublicSet.Myset.PJEWidth1 = Convert.ToDouble(tbPJEWidth1.Text);
            PublicSet.Myset.PArcAreaMax_Up1 = Convert.ToDouble(tbPArcAreaMax_Up1.Text);
            PublicSet.Myset.PArcAreaMax_Down1 = Convert.ToDouble(tbPArcAreaMax_Down1.Text);
            PublicSet.Myset.PArcAreaMin_Down1 = Convert.ToDouble(tbPArcAreaMin_Down1.Text);
            PublicSet.Myset.PArcGrayMin_Up1 = Convert.ToDouble(tbPArcGrayMin_Up1.Text);
            PublicSet.Myset.ChangeSet = true;
            Get_Bool(groupBox7);//极耳打折
            Get_Text(groupBox7);//极耳打折
            Get_Bool(groupBox6);//极耳打折
            Get_Text(groupBox6);//极耳打折


        }
        /// <summary>
        /// 保存缺角参数
        /// </summary>
        public void SavaBevel()
        {
            //负极三角形 矩形开关           
            PublicSet.Myset.NBevelTriangleSwitch = cBNBevelTriangleSwitch.Checked;
            //负左上
            PublicSet.Myset.NLeftUpBevelSwitch = cbNLeftUpBevelSwitch.Checked;
            PublicSet.Myset.NLeftUpBevelGrayMin = Convert.ToInt32(tbNLeftUpBevelGrayMin.Text);
            PublicSet.Myset.NLeftUpBevelAreaMin = Convert.ToDouble(tbNLeftUpBevelAreaMin.Text);
            PublicSet.Myset.NLeftUpBevelAreaMax = Convert.ToDouble(tbNLeftUpBevelAreaMax.Text);
            PublicSet.Myset.NLeftUpBevelFrame = Convert.ToDouble(tbNLeftUpBevelFrame.Text);
            PublicSet.Myset.NLeftUpBevelName = tbNLeftUpBevelName.Text;
            PublicSet.Myset.NLeftUpBevelCompensate = Convert.ToDouble(tbNLeftUpBevelCompensate.Text);
            //PublicSet.Myset.NLeftUpBevelRange = $"{PublicSet.Myset.PRightDownAngleStandard}±{PublicSet.Myset.PRightDownAngleMax - PublicSet.Myset.PRightDownAngleStandard}：";
            //负右上
            PublicSet.Myset.NRightUpBevelSwitch = cbNRightUpBevelSwitch.Checked;
            PublicSet.Myset.NRightUpBevelGrayMin = Convert.ToInt32(tbNRightUpBevelGrayMin.Text);
            PublicSet.Myset.NRightUpBevelAreaMin = Convert.ToDouble(tbNRightUpBevelAreaMin.Text);
            PublicSet.Myset.NRightUpBevelAreaMax = Convert.ToDouble(tbNRightUpBevelAreaMax.Text);
            PublicSet.Myset.NRightUpBevelFrame = Convert.ToDouble(tbNRightUpBevelFrame.Text);
            PublicSet.Myset.NRightUpBevelName = tbNRightUpBevelName.Text;
            PublicSet.Myset.NRightUpBevelCompensate = Convert.ToDouble(tbNRightUpBevelCompensate.Text);
            //负左下
            PublicSet.Myset.NLeftDownBevelSwitch = cbNLeftDownBevelSwitch.Checked;
            PublicSet.Myset.NLeftDownBevelGrayMin = Convert.ToInt32(tbNLeftDownBevelGrayMin.Text);
            PublicSet.Myset.NLeftDownBevelAreaMin = Convert.ToDouble(tbNLeftDownBevelAreaMin.Text);
            PublicSet.Myset.NLeftDownBevelAreaMax = Convert.ToDouble(tbNLeftDownBevelAreaMax.Text);
            PublicSet.Myset.NLeftDownBevelFrame = Convert.ToDouble(tbNLeftDownBevelFrame.Text);
            PublicSet.Myset.NLeftDownBevelName = tbNLeftDownBevelName.Text;
            PublicSet.Myset.NLeftDownBevelCompensate = Convert.ToDouble(tbNLeftDownBevelCompensate.Text);
            //负右下
            PublicSet.Myset.NRightDownBevelSwitch = cbNRightDownBevelSwitch.Checked;
            PublicSet.Myset.NRightDownBevelGrayMin = Convert.ToInt32(tbNRightDownBevelGrayMin.Text);
            PublicSet.Myset.NRightDownBevelAreaMin = Convert.ToDouble(tbNRightDownBevelAreaMin.Text);
            PublicSet.Myset.NRightDownBevelAreaMax = Convert.ToDouble(tbNRightDownBevelAreaMax.Text);
            PublicSet.Myset.NRightDownBevelFrame = Convert.ToDouble(tbNRightDownBevelFrame.Text);
            PublicSet.Myset.NRightDownBevelName = tbNRightDownBevelName.Text;
            PublicSet.Myset.NRightDownBevelCompensate = Convert.ToDouble(tbNRightDownBevelCompensate.Text);

            //正极三角形 矩形开关
            PublicSet.Myset.PBevelTriangleSwitch = cBPBevelTriangleSwitch.Checked;
            //正左上
            PublicSet.Myset.PLeftUpBevelSwitch = cbPLeftUpBevelSwitch.Checked;
            PublicSet.Myset.PLeftUpBevelGrayMin = Convert.ToInt32(tbPLeftUpBevelGrayMin.Text);
            PublicSet.Myset.PLeftUpBevelAreaMin = Convert.ToDouble(tbPLeftUpBevelAreaMin.Text);
            PublicSet.Myset.PLeftUpBevelAreaMax = Convert.ToDouble(tbPLeftUpBevelAreaMax.Text);
            PublicSet.Myset.PLeftUpBevelFrame = Convert.ToDouble(tbPLeftUpBevelFrame.Text);
            PublicSet.Myset.PLeftUpBevelName = tbPLeftUpBevelName.Text;
            PublicSet.Myset.PLeftUpBevelCompensate = Convert.ToDouble(tbPLeftUpBevelCompensate.Text);
            //正右上
            PublicSet.Myset.PRightUpBevelSwitch = cbPRightUpBevelSwitch.Checked;
            PublicSet.Myset.PRightUpBevelGrayMin = Convert.ToInt32(tbPRightUpBevelGrayMin.Text);
            PublicSet.Myset.PRightUpBevelAreaMin = Convert.ToDouble(tbPRightUpBevelAreaMin.Text);
            PublicSet.Myset.PRightUpBevelAreaMax = Convert.ToDouble(tbPRightUpBevelAreaMax.Text);
            PublicSet.Myset.PRightUpBevelFrame = Convert.ToDouble(tbPRightUpBevelFrame.Text);
            PublicSet.Myset.PRightUpBevelName = tbPRightUpBevelName.Text;
            PublicSet.Myset.PRightUpBevelCompensate = Convert.ToDouble(tbPRightUpBevelCompensate.Text);
            //正左下
            PublicSet.Myset.PLeftDownBevelSwitch = cbPLeftDownBevelSwitch.Checked;
            PublicSet.Myset.PLeftDownBevelGrayMin = Convert.ToInt32(tbPLeftDownBevelGrayMin.Text);
            PublicSet.Myset.PLeftDownBevelAreaMin = Convert.ToDouble(tbPLeftDownBevelAreaMin.Text);
            PublicSet.Myset.PLeftDownBevelAreaMax = Convert.ToDouble(tbPLeftDownBevelAreaMax.Text);
            PublicSet.Myset.PLeftDownBevelFrame = Convert.ToDouble(tbPLeftDownBevelFrame.Text);
            PublicSet.Myset.PLeftDownBevelName = tbPLeftDownBevelName.Text;
            PublicSet.Myset.PLeftDownBevelCompensate = Convert.ToDouble(tbPLeftDownBevelCompensate.Text);
            //正右下
            PublicSet.Myset.PRightDownBevelSwitch = cbPRightDownBevelSwitch.Checked;
            PublicSet.Myset.PRightDownBevelGrayMin = Convert.ToInt32(tbPRightDownBevelGrayMin.Text);
            PublicSet.Myset.PRightDownBevelAreaMin = Convert.ToDouble(tbPRightDownBevelAreaMin.Text);
            PublicSet.Myset.PRightDownBevelAreaMax = Convert.ToDouble(tbPRightDownBevelAreaMax.Text);
            PublicSet.Myset.PRightDownBevelFrame = Convert.ToDouble(tbPRightDownBevelFrame.Text);
            PublicSet.Myset.PRightDownBevelName = tbPRightDownBevelName.Text;
            PublicSet.Myset.PRightDownBevelCompensate = Convert.ToDouble(tbPRightDownBevelCompensate.Text);
            PublicSet.Myset.ChangeSet = true;
            Get_Bool(groupBox3);//缺角
            Get_Text(groupBox3);//缺角
            Get_Text(gbNBevelCompensate);//缺角

            Get_Bool(groupBox1);//缺角
            Get_Text(groupBox1);//缺角
            Get_Text(gbPBevelCompensate);//缺角
        }
        /// <summary>
        /// 保存储存设置
        /// </summary>
        public void SavaStorage()
        {
            PublicSet.Myset.ImageIstitching = cbImageIstitching.Checked;
            PublicSet.Myset.ImageEncryption = cbImageEncryption.Checked;

            PublicSet.Myset.OriginalPictureSwitch = cbOriginalPictureSwitch.Checked;
            tbPathO.Text = PublicSet.Myset.PathO = GetStorageSetPath(tbPathO.Text);
            PublicSet.Myset.NamingRuleO = tBNamingRuleO.Text;
            PublicSet.Myset.DayO = Convert.ToInt32(nudDayO.Text);

            PublicSet.Myset.NGOriginalPictureSwitch = cbNGOriginalPictureSwitch.Checked;
            tbPathNGO.Text = PublicSet.Myset.PathNGO = GetStorageSetPath(tbPathNGO.Text);
            PublicSet.Myset.NamingRuleNGO = tBNamingRuleNGO.Text;
            PublicSet.Myset.DayNGO = Convert.ToInt32(nudDayNGO.Text);

            PublicSet.Myset.EffectPictureSwitch = cbEffectPictureSwitch.Checked;
            tbPathE.Text = PublicSet.Myset.PathE = GetStorageSetPath(tbPathE.Text);
            PublicSet.Myset.NamingRuleE = tBNamingRuleE.Text;
            PublicSet.Myset.DayE = Convert.ToInt32(nudDayE.Text);

            PublicSet.Myset.NGPictureSwitch = cbNGPictureSwitch.Checked;
            tbPathNG.Text = PublicSet.Myset.PathNG = GetStorageSetPath(tbPathNG.Text);
            PublicSet.Myset.NamingRuleNG = tBNamingRuleNG.Text;
            PublicSet.Myset.DayNG = Convert.ToInt32(nudDayNG.Text);

            PublicSet.Myset.MESPictureSwitch = cbMESPictureSwitch.Checked;
            tbPathMES.Text = PublicSet.Myset.PathMES = GetStorageSetPath(tbPathMES.Text);
            PublicSet.Myset.NamingRuleMES = tBNamingRuleMES.Text;

            PublicSet.Myset.ImangeFormatO = cbImangeFormatO.Text;
            PublicSet.Myset.ImangeFormatNGO = cbImangeFormatNGO.Text;
            PublicSet.Myset.ImangeFormatE = cbImangeFormatE.Text;
            PublicSet.Myset.ImangeFormatNG = cbImangeFormatNG.Text;
            PublicSet.Myset.ImangeFormatMES = cbImangeFormatMES.Text;

            PublicSet.Myset.SCDataSava = tbSCDataSava.Text;
            PublicSet.Myset.TJDataSava = tbTJDataSava.Text;
            PublicSet.Myset.PWDataSava = tbPWDataSava.Text;
            PublicSet.Myset.MESDataSava = tbMESDataSava.Text;
            PublicSet.Myset.MESDataSwitch = cbMESDataSwitch.Checked;

            PublicSet.Myset.SCDataSavaDay = int.Parse(nudSCDataSavaDay.Text);
            PublicSet.Myset.TJDataSavaDay = int.Parse(nudTJDataSavaDay.Text);
            PublicSet.Myset.PWDataSavaDay = int.Parse(nudPWDataSavaDay.Text);
            PublicSet.Myset.MESDataSavaDay = int.Parse(nudMESDataSavaDay.Text);

            PublicSet.Myset.SCName = tbSCName.Text;
            PublicSet.Myset.TJName = tbTJName.Text;
            PublicSet.Myset.PWName = tbPWName.Text;
            PublicSet.Myset.MESName = tbMESName.Text;

            PublicSet.Myset.Morn = dtpMornHour.Value.ToString("HH:mm");
            PublicSet.Myset.Night = dtpNightHour.Value.ToString("HH:mm");

            PublicSet.Cameraset.LineID = tbLineID.Text;
            PublicSet.Cameraset.MachineID = tbMachineID.Text;

            PublicSet.Myset.PathLog = tbPathLog.Text;

            Get_Bool(groupBox5);//存储图
            Get_Text(groupBox5);//存储图
            Get_Text(groupBox21);//线体编号
            Get_Text(groupBox21);//线体编号         
        }
        /// <summary>
        /// 保存数据库设置
        /// </summary>
        public void SavaDataBase()
        {
            PublicSet.Myset.MySqlServer = tbMySqlServer.Text;
            PublicSet.Myset.MySqlUserId = tbMySqlUserId.Text;
            PublicSet.Myset.MySqlPassword = tbMySqlPassword.Text;
        }
        /// <summary>
        /// 保存检测项优先级
        /// </summary>
        public void SavaDetectionItemPriority()
        {
            PublicSet.DicDetectionItemPriority.Clear();
            for (int i = 0; i < DGVDetectionItemPriority.RowCount - 1; i++)
            {
                PublicSet.DicDetectionItemPriority.Add(i + 1, DGVDetectionItemPriority.Rows[i].Cells[1].Value.ToString());
            }
        }

        /// <summary>
        /// 保存系统设置
        /// </summary>
        public void SavaSystem()
        {
            PublicSet.Myset.DataPrioritySwitch = cbDataPrioritySwitch.Checked;

            PublicSet.Myset.DetectMode = cbDetectMode.SelectedItem.ToString();
            PublicSet.Myset.PositiveSwitch = cbPositiveSwitch.Checked;
            PublicSet.Myset.NegativeSwitch = cbNegativeSwitch.Checked;
            PublicSet.Myset.NullSliceP = cbNullSliceP.Checked;
            PublicSet.Myset.NullSliceN = cbNullSliceN.Checked;
            PublicSet.Myset.picFileName = tbpicFileName.Text;
            PublicSet.Myset.iconFileName = tbiconFileName.Text;
            PublicSet.Myset.TJ_Hour = cbTJ_Hour.Checked;
            PublicSet.Myset.EarlyWarning = cbEarlyWarning.Checked;

            PublicSet.Myset.NLeftArcSize = double.Parse(tbNLeftArcSize.Text);
            PublicSet.Myset.PLeftArcSize = double.Parse(tbPLeftArcSize.Text);
            PublicSet.Myset.NLeftArcColSkew = double.Parse(tbNLeftArcColSkew.Text);
            PublicSet.Myset.PLeftArcColSkew = double.Parse(tbPLeftArcColSkew.Text);
            PublicSet.Myset.NLeftArcRowSkew = double.Parse(tbNLeftArcRowSkew.Text);
            PublicSet.Myset.PLeftArcRowSkew = double.Parse(tbPLeftArcRowSkew.Text);

            PublicSet.Myset.NRightArcSize = double.Parse(tbNRightArcSize.Text);
            PublicSet.Myset.PRightArcSize = double.Parse(tbPRightArcSize.Text);
            PublicSet.Myset.NRightArcColSkew = double.Parse(tbNRightArcColSkew.Text);
            PublicSet.Myset.PRightArcColSkew = double.Parse(tbPRightArcColSkew.Text);
            PublicSet.Myset.NRightArcRowSkew = double.Parse(tbNRightArcRowSkew.Text);
            PublicSet.Myset.PRightArcRowSkew = double.Parse(tbPRightArcRowSkew.Text);
            PublicSet.Myset.OEEData = cbOEEData.Checked;
            PublicSet.Myset.SwipingCardLogin = cbSwipingCardLogin.Checked;

            radioButton13.Visible = tbNJEHeight1.Visible = tbNJEWidth1.Visible = tbPJEHeight1.Visible = tbPJEWidth1.Visible = label57.Visible = cbPJELocation1.Visible = label56.Visible = cbNJELocation1.Visible = PublicSet.Myset.JETwoCamera = cbJETwoCamera.Checked;

        }

        private void button10_Click(object sender, EventArgs e)
        {
            try
            {
                switch (tabSet.SelectedIndex)
                {
                    case 0: SaveCommunicate(); Tool.LogSystemRuning("保存通讯设置！"); break;
                    case 1: SaveCamera(); Tool.LogSystemRuning("保存相机设置！"); break;
                    case 2: SaveNCraft(); Tool.LogSystemRuning("保存负极工艺设置！"); break;
                    case 3: SaveNVCraft(); Tool.LogSystemRuning("保存负极V角工艺设置！"); break;
                    case 4: SavePCraft(); Tool.LogSystemRuning("保存正极工艺设置！"); break;
                    case 5: SavePVCraft(); Tool.LogSystemRuning("保存正极V角工艺设置！"); break;
                    case 6: SaveBevelLimit(); Tool.LogSystemRuning("保存极耳打折工艺设置！"); break;
                    case 7: SavaBevel(); Tool.LogSystemRuning("保存缺角工艺设置！"); break;
                    case 8: SavaStorage(); Tool.LogSystemRuning("保存存储设置！"); break;
                    case 9: SavaDataBase(); Tool.LogSystemRuning("保存数据库设置！"); break;
                    case 10: SavaDetectionItemPriority(); Tool.LogSystemRuning("保存优先级设置！"); break;
                    case 12: SaveBevelLimit_Two(); Tool.LogSystemRuning("保存极耳打折工艺-壹！"); break;
                    default: SavaSystem(); Tool.LogSystemRuning("保存系统设置！"); break;
                }
                //MessageBox.Show("保存成功", "保存参数", MessageBoxButtons.OK, MessageBoxIcon.Information);
                ToastNotification.Show("保存成功");
            }
            catch (Exception ex)
            {
                ToastNotification.Show("保存失败，请检查输入的值是否正确！");
            }
        }

        private void button11_Click(object sender, EventArgs e)
        {
            try
            {
                SaveCamera();
                SaveCommunicate();
                SaveNCraft();
                SaveNVCraft();
                SavePCraft();
                SavePVCraft();
                SaveBevelLimit();
                SavaBevel();
                SavaStorage();
                SavaDataBase();
                SavaDetectionItemPriority();
                SavaSystem();
                MessageBox.Show("保存成功", "保存参数", MessageBoxButtons.OK, MessageBoxIcon.Information);
                Tool.LogSystemRuning("保存所有设置！");
            }
            catch (Exception)
            {
                MessageBox.Show("保存失败，请检查输入的值是否正确！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
        #endregion

        /// <summary>
        /// 分割存储路径，判断年月日是否在所有特殊字符前面，将年月日放在前面 并且拼接完成 返回存储路径
        /// </summary>
        /// <param name="path"></param>
        /// <returns></returns>
        string GetStorageSetPath(string path)
        {
            string[] s = path.Split('\\');
            int[] icount = new int[s.Length + 1];
            for (int i = 0; i < s.Length; i++)
            {
                if (s[i].Contains("NorP"))
                {
                    icount[i + 1] = i;
                }
                else if (s[i].Contains("WS"))
                {
                    icount[i + 1] = i;
                }
                else if (s[i].Contains("PoleReel"))
                {
                    icount[i + 1] = i;
                }
            }
            icount[0] = Array.IndexOf(s, "yyyy-MM-dd");
            int min = icount[0]; string str = "yyyy-MM-dd";
            for (int i = 1; i < icount.Length; i++)
            {
                if (icount[i] < min && icount[i] > 0)
                {
                    min = icount[i]; str = s[min];
                }
            }
            s[min] = "yyyy-MM-dd"; s[icount[0]] = str;
            string sd;
            return sd = string.Join("\\", s);
        }


        private void bClose_Click(object sender, EventArgs e)
        {
            if (PublicSet.userInfo.power == Power.开发者权限)
            {
                PublicSet.Myset.ChangeSet_Developer = true;
                int count = 0, count1 = 0;
                #region 负极工艺
                //极片头宽
                if (PublicSet.Myset.NJPHeadWidthSwitch) ++count;
                PublicSet.Myset.NJPHeadWidthSwitch_Developer = PublicSet.Myset.NJPHeadWidthSwitch;
                //极片尾宽
                if (PublicSet.Myset.NJPTailWidthSwitch) ++count;
                PublicSet.Myset.NJPTailWidthSwitch_Developer = PublicSet.Myset.NJPTailWidthSwitch;
                //极片头长
                if (PublicSet.Myset.NJPHeadLengthSwitch) ++count;
                PublicSet.Myset.NJPHeadLengthSwitch_Developer = PublicSet.Myset.NJPHeadLengthSwitch;
                //极片尾长
                if (PublicSet.Myset.NJPTailLengthSwitch) ++count;
                PublicSet.Myset.NJPTailLengthSwitch_Developer = PublicSet.Myset.NJPTailLengthSwitch;
                //左肩宽
                if (PublicSet.Myset.NJELeftShoulderSwitch) ++count;
                PublicSet.Myset.NJELeftShoulderSwitch_Developer = PublicSet.Myset.NJELeftShoulderSwitch;
                //右肩宽
                if (PublicSet.Myset.NJERightShoulderSwitch) ++count;
                PublicSet.Myset.NJERightShoulderSwitch_Developer = PublicSet.Myset.NJERightShoulderSwitch;
                //极耳宽
                if (PublicSet.Myset.NJEWidthSwitch) ++count;
                PublicSet.Myset.NJEWidthSwitch_Developer = PublicSet.Myset.NJEWidthSwitch;
                //极耳高
                if (PublicSet.Myset.NJEHeightSwitch) ++count;
                PublicSet.Myset.NJEHeightSwitch_Developer = PublicSet.Myset.NJEHeightSwitch;
                //带料高
                if (PublicSet.Myset.NDLHeightSwitch) ++count;
                PublicSet.Myset.NDLHeightSwitch_Developer = PublicSet.Myset.NDLHeightSwitch;
                //总宽
                if (PublicSet.Myset.NJPTotalWidthSwitch) ++count;
                PublicSet.Myset.NJPTotalWidthSwitch_Developer = PublicSet.Myset.NJPTotalWidthSwitch;
                //涂布高
                if (PublicSet.Myset.NJPCoatingSwitch) ++count;
                PublicSet.Myset.NJPCoatingSwitch_Developer = PublicSet.Myset.NJPCoatingSwitch;
                //对角线
                if (PublicSet.Myset.NDiagonalSwitch) ++count;
                PublicSet.Myset.NDiagonalSwitch_Developer = PublicSet.Myset.NDiagonalSwitch;
                //左上垂直角度
                if (PublicSet.Myset.NLeftUpAngleSwitch) ++count;
                PublicSet.Myset.NLeftUpAngleSwitch_Developer = PublicSet.Myset.NLeftUpAngleSwitch;
                //右上垂直角度
                if (PublicSet.Myset.NRightUpAngleSwitch) ++count;
                PublicSet.Myset.NRightUpAngleSwitch_Developer = PublicSet.Myset.NRightUpAngleSwitch;
                //左下垂直角度
                if (PublicSet.Myset.NLeftDownAngleSwitch) ++count;
                PublicSet.Myset.NLeftDownAngleSwitch_Developer = PublicSet.Myset.NLeftDownAngleSwitch;
                //右下垂直角度
                if (PublicSet.Myset.NRightDownAngleSwitch) ++count;
                PublicSet.Myset.NRightDownAngleSwitch_Developer = PublicSet.Myset.NRightDownAngleSwitch;
                //mark点
                if (PublicSet.Myset.NMarkSwitch) ++count;
                PublicSet.Myset.NMarkSwitch_Developer = PublicSet.Myset.NMarkSwitch;
                tbNMarkName.Visible = false;
                tbNMarkCompensate.Visible = false;
                radioButton3.Visible = count == 0 ? false : true;
                #endregion

                #region 负极V角工艺
                count = 0;
                if (PublicSet.Myset.NLeftUpVAngleSwitch) ++count;
                PublicSet.Myset.NLeftUpVAngleSwitch_Developer = PublicSet.Myset.NLeftUpVAngleSwitch;

                if (PublicSet.Myset.NLeftUpVWidthSwitch) ++count;
                PublicSet.Myset.NLeftUpVWidthSwitch_Developer = PublicSet.Myset.NLeftUpVWidthSwitch;

                if (PublicSet.Myset.NLeftUpVDepthSwitch) ++count;
                PublicSet.Myset.NLeftUpVDepthSwitch_Developer = PublicSet.Myset.NLeftUpVDepthSwitch;


                if (PublicSet.Myset.NRightUpVAngleSwitch) ++count;
                PublicSet.Myset.NRightUpVAngleSwitch_Developer = PublicSet.Myset.NRightUpVAngleSwitch;

                if (PublicSet.Myset.NRightUpVWidthSwitch) ++count;
                PublicSet.Myset.NRightUpVWidthSwitch_Developer = PublicSet.Myset.NRightUpVWidthSwitch;

                if (PublicSet.Myset.NRightUpVDepthSwitch) ++count;
                PublicSet.Myset.NRightUpVDepthSwitch_Developer = PublicSet.Myset.NRightUpVDepthSwitch;

                if (PublicSet.Myset.NLeftDownVAngleSwitch) ++count;
                PublicSet.Myset.NLeftDownVAngleSwitch_Developer = PublicSet.Myset.NLeftDownVAngleSwitch;

                if (PublicSet.Myset.NLeftDownVWidthSwitch) ++count;
                PublicSet.Myset.NLeftDownVWidthSwitch_Developer = PublicSet.Myset.NLeftDownVWidthSwitch;

                if (PublicSet.Myset.NLeftDownVDepthSwitch) ++count;
                PublicSet.Myset.NLeftDownVDepthSwitch_Developer = PublicSet.Myset.NLeftDownVDepthSwitch;

                if (PublicSet.Myset.NRightDownVAngleSwitch) ++count;
                PublicSet.Myset.NRightDownVAngleSwitch_Developer = PublicSet.Myset.NRightDownVAngleSwitch;

                if (PublicSet.Myset.NRightDownVWidthSwitch) ++count;
                PublicSet.Myset.NRightDownVWidthSwitch_Developer = PublicSet.Myset.NRightDownVWidthSwitch;

                if (PublicSet.Myset.NRightDownVDepthSwitch) ++count;
                PublicSet.Myset.NRightDownVDepthSwitch_Developer = PublicSet.Myset.NRightDownVDepthSwitch;
                radioButton4.Visible = count == 0 ? false : true;
                #endregion

                #region 正极工艺
                count = 0;
                //极片头宽
                if (PublicSet.Myset.PJPHeadWidthSwitch) ++count;
                PublicSet.Myset.PJPHeadWidthSwitch_Developer = PublicSet.Myset.PJPHeadWidthSwitch;
                //极片尾宽
                if (PublicSet.Myset.PJPTailWidthSwitch) ++count;
                PublicSet.Myset.PJPTailWidthSwitch_Developer = PublicSet.Myset.PJPTailWidthSwitch;
                //极片头长
                if (PublicSet.Myset.PJPHeadLengthSwitch) ++count;
                PublicSet.Myset.PJPHeadLengthSwitch_Developer = PublicSet.Myset.PJPHeadLengthSwitch;
                //极片尾长
                if (PublicSet.Myset.PJPTailLengthSwitch) ++count;
                PublicSet.Myset.PJPTailLengthSwitch_Developer = PublicSet.Myset.PJPTailLengthSwitch;
                //左肩宽
                if (PublicSet.Myset.PJELeftShoulderSwitch) ++count;
                PublicSet.Myset.PJELeftShoulderSwitch_Developer = PublicSet.Myset.PJELeftShoulderSwitch;
                //右肩宽
                if (PublicSet.Myset.PJERightShoulderSwitch) ++count;
                PublicSet.Myset.PJERightShoulderSwitch_Developer = PublicSet.Myset.PJERightShoulderSwitch;
                //极耳宽
                if (PublicSet.Myset.PJEWidthSwitch) ++count;
                PublicSet.Myset.PJEWidthSwitch_Developer = PublicSet.Myset.PJEWidthSwitch;
                //极耳高
                if (PublicSet.Myset.PJEHeightSwitch) ++count;
                PublicSet.Myset.PJEHeightSwitch_Developer = PublicSet.Myset.PJEHeightSwitch;
                //带料高
                if (PublicSet.Myset.PCeramicHeightSwitch) ++count;
                PublicSet.Myset.PCeramicHeightSwitch_Developer = PublicSet.Myset.PCeramicHeightSwitch;
                //总宽
                if (PublicSet.Myset.PJPTotalWidthSwitch) ++count;
                PublicSet.Myset.PJPTotalWidthSwitch_Developer = PublicSet.Myset.PJPTotalWidthSwitch;
                //涂布高
                if (PublicSet.Myset.PJPCoatingSwitch) ++count;
                PublicSet.Myset.PJPCoatingSwitch_Developer = PublicSet.Myset.PJPCoatingSwitch;
                //对角线
                if (PublicSet.Myset.PDiagonalSwitch) ++count;
                PublicSet.Myset.PDiagonalSwitch_Developer = PublicSet.Myset.PDiagonalSwitch;
                //左上垂直角度
                if (PublicSet.Myset.PLeftUpAngleSwitch) ++count;
                PublicSet.Myset.PLeftUpAngleSwitch_Developer = PublicSet.Myset.PLeftUpAngleSwitch;
                //右上垂直角度
                if (PublicSet.Myset.PRightUpAngleSwitch) ++count;
                PublicSet.Myset.PRightUpAngleSwitch_Developer = PublicSet.Myset.PRightUpAngleSwitch;
                //左下垂直角度
                if (PublicSet.Myset.PLeftDownAngleSwitch) ++count;
                PublicSet.Myset.PLeftDownAngleSwitch_Developer = PublicSet.Myset.PLeftDownAngleSwitch;
                //右下垂直角度
                if (PublicSet.Myset.PRightDownAngleSwitch) ++count;
                PublicSet.Myset.PRightDownAngleSwitch_Developer = PublicSet.Myset.PRightDownAngleSwitch;
                //mark点
                if (PublicSet.Myset.PMarkSwitch) ++count;
                PublicSet.Myset.PMarkSwitch_Developer = PublicSet.Myset.PMarkSwitch;
                tbPMarkName.Visible = false;
                radioButton5.Visible = count == 0 ? false : true;
                #endregion

                #region 正极V角工艺
                count = 0;
                if (PublicSet.Myset.PLeftUpVAngleSwitch) ++count;
                PublicSet.Myset.PLeftUpVAngleSwitch_Developer = PublicSet.Myset.PLeftUpVAngleSwitch;

                if (PublicSet.Myset.PLeftUpVWidthSwitch) ++count;
                PublicSet.Myset.PLeftUpVWidthSwitch_Developer = PublicSet.Myset.PLeftUpVWidthSwitch;

                if (PublicSet.Myset.PLeftUpVDepthSwitch) ++count;
                PublicSet.Myset.PLeftUpVDepthSwitch_Developer = PublicSet.Myset.PLeftUpVDepthSwitch;

                if (PublicSet.Myset.PRightUpVAngleSwitch) ++count;
                PublicSet.Myset.PRightUpVAngleSwitch_Developer = PublicSet.Myset.PRightUpVAngleSwitch;

                if (PublicSet.Myset.PRightUpVWidthSwitch) ++count;
                PublicSet.Myset.PRightUpVWidthSwitch_Developer = PublicSet.Myset.PRightUpVWidthSwitch;

                if (PublicSet.Myset.PRightUpVDepthSwitch) ++count;
                PublicSet.Myset.PRightUpVDepthSwitch_Developer = PublicSet.Myset.PRightUpVDepthSwitch;

                if (PublicSet.Myset.PLeftDownVAngleSwitch) ++count;
                PublicSet.Myset.PLeftDownVAngleSwitch_Developer = PublicSet.Myset.PLeftDownVAngleSwitch;

                if (PublicSet.Myset.PLeftDownVWidthSwitch) ++count;
                PublicSet.Myset.PLeftDownVWidthSwitch_Developer = PublicSet.Myset.PLeftDownVWidthSwitch;

                if (PublicSet.Myset.PLeftDownVDepthSwitch) ++count;
                PublicSet.Myset.PLeftDownVDepthSwitch_Developer = PublicSet.Myset.PLeftDownVDepthSwitch;

                if (PublicSet.Myset.PRightDownVAngleSwitch) ++count;
                PublicSet.Myset.PRightDownVAngleSwitch_Developer = PublicSet.Myset.PRightDownVAngleSwitch;

                if (PublicSet.Myset.PRightDownVWidthSwitch) ++count;
                PublicSet.Myset.PRightDownVWidthSwitch_Developer = PublicSet.Myset.PRightDownVWidthSwitch;

                if (PublicSet.Myset.PRightDownVDepthSwitch) ++count;
                PublicSet.Myset.PRightDownVDepthSwitch_Developer = PublicSet.Myset.PRightDownVDepthSwitch;
                radioButton6.Visible = count == 0 ? false : true;

                #endregion

                #region  极耳打折
                count = 0;
                PublicSet.Myset.NJEBevelLimitSwitch_Developer = PublicSet.Myset.NJEBevelLimitSwitch;
                PublicSet.Myset.PJEBevelLimitSwitch_Developer = PublicSet.Myset.PJEBevelLimitSwitch;
                if (PublicSet.Myset.NJEBevelLimitSwitch) ++count;
                if (PublicSet.Myset.PJEBevelLimitSwitch) ++count;
                radioButton7.Visible = count == 0 ? false : true;
                #endregion

                #region  缺角
                count = 0;
                //负极左上
                if (PublicSet.Myset.NLeftUpBevelSwitch) ++count;
                PublicSet.Myset.NLeftUpBevelSwitch_Developer = PublicSet.Myset.NLeftUpBevelSwitch;
                //负极右上
                if (PublicSet.Myset.NRightUpBevelSwitch) ++count;
                PublicSet.Myset.NRightUpBevelSwitch_Developer = PublicSet.Myset.NRightUpBevelSwitch;
                //负极左下
                if (PublicSet.Myset.NLeftDownBevelSwitch) ++count;
                PublicSet.Myset.NLeftDownBevelSwitch_Developer = PublicSet.Myset.NLeftDownBevelSwitch;
                //负极右下
                if (PublicSet.Myset.NRightDownBevelSwitch) ++count;
                PublicSet.Myset.NRightDownBevelSwitch_Developer = PublicSet.Myset.NRightDownBevelSwitch;
                groupBox3.Visible = count == 0 ? false : true;

                //正极左上
                count1 = 0;
                if (PublicSet.Myset.PLeftUpBevelSwitch) ++count1;
                PublicSet.Myset.PLeftUpBevelSwitch_Developer = PublicSet.Myset.PLeftUpBevelSwitch;
                //正极右上
                if (PublicSet.Myset.PRightUpBevelSwitch) ++count1;
                PublicSet.Myset.PRightUpBevelSwitch_Developer = PublicSet.Myset.PRightUpBevelSwitch;
                //正极左下
                if (PublicSet.Myset.PLeftDownBevelSwitch) ++count1;
                PublicSet.Myset.PLeftDownBevelSwitch_Developer = PublicSet.Myset.PLeftDownBevelSwitch;
                //正极右下
                if (PublicSet.Myset.PRightDownBevelSwitch) ++count1;
                PublicSet.Myset.PRightDownBevelSwitch_Developer = PublicSet.Myset.PRightDownBevelSwitch;
                groupBox1.Visible = count1 == 0 ? false : true;
                if (count == 0 && count1 == 0) radioButton8.Visible = false;
                #endregion

                #region  系统设置 空片开关开发者权限
                PublicSet.Myset.NullSliceN_Developer = PublicSet.Myset.NullSliceN;
                PublicSet.Myset.NullSliceP_Developer = PublicSet.Myset.NullSliceP;
                PublicSet.Myset.SwipingCardLogin_Developer = PublicSet.Myset.SwipingCardLogin;
                #endregion
            }
            Tool.LogSystemRuning("关闭设置！");
            Close();
        }



        private void FormSet_Load(object sender, EventArgs e)
        {
            Tool.LogSystemRuning("打开设置！");
            if (PublicSet.userInfo.power == Power.操作员)
            {
                tabSet.Enabled = false;
            }
            else if (PublicSet.userInfo.power <= Power.管理员)
            {
                tabSet.Enabled = true;
                gbCamera.Enabled = false;
                gbCommunicationMode.Enabled = false;
                gbCommunicationIP.Enabled = false;
                gbCommunicationParam.Enabled = false;

                gbCamera.Enabled = false;
                gbCommunicationMode.Enabled = false;
                gbCommunicationIP.Enabled = false;
                gbCommunicationParam.Enabled = false;
                gbDataBase.Enabled = false;
                groupBox4.Enabled = false;
                groupBox2.Enabled = false;
            }
            else
            {
                tabSet.Enabled = true;
                gbCamera.Enabled = true;
                gbCommunicationMode.Enabled = true;
                gbCommunicationIP.Enabled = true;
                gbCommunicationParam.Enabled = true;

                gbCamera.Enabled = true;
                gbCommunicationMode.Enabled = true;
                gbCommunicationIP.Enabled = true;
                gbCommunicationParam.Enabled = true;
                gbDataBase.Enabled = true;
                groupBox4.Enabled = true;
                groupBox2.Enabled = true;
            }
            if (!Ui || PublicSet.Myset.ChangeSet || PublicSet.Myset.ChangeSet_Developer)
            {


                CommunicateSetUI();
                NCraftSetUI();
                NVCraftSetUI();
                PCraftSetUI();
                PVCraftSetUI();
                BevelLimitSetUI();
                BevelSetUI();
                StorageSetUI();
                DataBaseSetUI();
                SystemSetUI();
                BevelLimitSetUI_Two();
                Ui = true;
                PublicSet.Myset.ChangeSet = false;
                PublicSet.Myset.ChangeSet_Developer = false;
                #region 获取原始参数
                GetControl_Text(gbCamera);//相机页
                GetControl_Bool(gbCommunicationMode);//通讯方式
                GetControl_Text(gbCommunicationIP);//通讯地址
                GetControl_Text(gbCommunicationParam);//通讯地址参数

                GetControl_Bool(tab3);//负极工艺
                GetControl_Text(tab3);//负极工艺
                GetControl_Text(gbNCompensate);//负极工艺补偿值


                GetControl_Bool(tab4);//负极V工艺
                GetControl_Text(tab4);//负极V工艺
                GetControl_Text(gbNVCompensate);//负极工艺V补偿值

                GetControl_Bool(tab5);//正极工艺
                GetControl_Text(tab5);//正极工艺
                GetControl_Text(gbPCompensate);//正极工艺补偿值

                GetControl_Bool(tab6);//正极V工艺
                GetControl_Text(tab6);//正极V工艺
                GetControl_Text(gbPVCompensate);//正极工艺V补偿值

                GetControl_Bool(groupBox22);//极耳打折
                GetControl_Text(groupBox22);//极耳打折
                GetControl_Bool(groupBox15);//极耳打折
                GetControl_Text(groupBox15);//极耳打折

                GetControl_Bool(groupBox6);//极耳打折-壹 极耳双相机时使用
                GetControl_Text(groupBox6);//极耳打折-壹-极耳双相机时使用
                GetControl_Bool(groupBox7);//极耳打折-壹-极耳双相机时使用
                GetControl_Text(groupBox7);//极耳打折-壹-极耳双相机时使用

                GetControl_Bool(groupBox3);//负极缺角
                GetControl_Text(groupBox3);//负极缺角
                GetControl_Text(gbNBevelCompensate);//负极缺角补偿值

                GetControl_Bool(groupBox1);//正极缺角
                GetControl_Text(groupBox1);//正极缺角
                GetControl_Text(gbPBevelCompensate);//正极缺角补偿值

                GetControl_Bool(groupBox5);//存储图
                GetControl_Text(groupBox5);//存储图

                GetControl_Text(groupBox21);//线体编号

                GetControl_Text(groupBox21);//线体编号
                #endregion

                if (PublicSet.userInfo.power != Power.开发者权限)
                {
                    int count = 0, count1 = 0;
                    #region 负极工艺
                    //极片头宽
                    if (PublicSet.Myset.NJPHeadWidthSwitch_Developer) ++count;
                    lNJPHeadWidth.Visible = PublicSet.Myset.NJPHeadWidthSwitch_Developer;
                    cbNJPHeadWidthSwitch.Visible = PublicSet.Myset.NJPHeadWidthSwitch_Developer;
                    tbNJPHeadWidthStandard.Visible = PublicSet.Myset.NJPHeadWidthSwitch_Developer;
                    tbNJPHeadWidthMax.Visible = PublicSet.Myset.NJPHeadWidthSwitch_Developer;
                    tbNJPHeadWidthMin.Visible = PublicSet.Myset.NJPHeadWidthSwitch_Developer;
                    tbNJPHeadWidthName.Visible = PublicSet.Myset.NJPHeadWidthSwitch_Developer;
                    tbNJPHeadWidthCompensate.Visible = PublicSet.Myset.NJPHeadWidthSwitch_Developer;
                    //极片尾宽
                    if (PublicSet.Myset.NJPTailWidthSwitch_Developer) ++count;
                    lNJPTailWidth.Visible = PublicSet.Myset.NJPTailWidthSwitch_Developer;
                    cbNJPTailWidthSwitch.Visible = PublicSet.Myset.NJPTailWidthSwitch_Developer;
                    tbNJPTailWidthStandard.Visible = PublicSet.Myset.NJPTailWidthSwitch_Developer;
                    tbNJPTailWidthMax.Visible = PublicSet.Myset.NJPTailWidthSwitch_Developer;
                    tbNJPTailWidthMin.Visible = PublicSet.Myset.NJPTailWidthSwitch_Developer;
                    tbNJPTailWidthName.Visible = PublicSet.Myset.NJPTailWidthSwitch_Developer;
                    tbNJPTailWidthCompensate.Visible = PublicSet.Myset.NJPTailWidthSwitch_Developer;
                    //极片头长
                    if (PublicSet.Myset.NJPHeadLengthSwitch_Developer) ++count;
                    lNJPHeadLength.Visible = PublicSet.Myset.NJPHeadLengthSwitch_Developer;
                    cbNJPHeadLengthSwitch.Visible = PublicSet.Myset.NJPHeadLengthSwitch_Developer;
                    tbNJPHeadLengthStandard.Visible = PublicSet.Myset.NJPHeadLengthSwitch_Developer;
                    tbNJPHeadLengthMax.Visible = PublicSet.Myset.NJPHeadLengthSwitch_Developer;
                    tbNJPHeadLengthMin.Visible = PublicSet.Myset.NJPHeadLengthSwitch_Developer;
                    tbNJPHeadLengthName.Visible = PublicSet.Myset.NJPHeadLengthSwitch_Developer;
                    tbNJPHeadLengthCompensate.Visible = PublicSet.Myset.NJPHeadLengthSwitch_Developer;
                    //极片尾长
                    if (PublicSet.Myset.NJPTailLengthSwitch_Developer) ++count;
                    lNJPTailLength.Visible = PublicSet.Myset.NJPTailLengthSwitch_Developer;
                    cbNJPTailLengthSwitch.Visible = PublicSet.Myset.NJPTailLengthSwitch_Developer;
                    tbNJPTailLengthStandard.Visible = PublicSet.Myset.NJPTailLengthSwitch_Developer;
                    tbNJPTailLengthMax.Visible = PublicSet.Myset.NJPTailLengthSwitch_Developer;
                    tbNJPTailLengthMin.Visible = PublicSet.Myset.NJPTailLengthSwitch_Developer;
                    tbNJPTailLengthName.Visible = PublicSet.Myset.NJPTailLengthSwitch_Developer;
                    tbNJPTailLengthCompensate.Visible = PublicSet.Myset.NJPTailLengthSwitch_Developer;
                    //左肩宽
                    if (PublicSet.Myset.NJELeftShoulderSwitch_Developer) ++count;
                    lNJELeftShoulder.Visible = PublicSet.Myset.NJELeftShoulderSwitch_Developer;
                    cbNJELeftShoulderSwitch.Visible = PublicSet.Myset.NJELeftShoulderSwitch_Developer;
                    tbNJELeftShoulderStandard.Visible = PublicSet.Myset.NJELeftShoulderSwitch_Developer;
                    tbNJELeftShoulderMax.Visible = PublicSet.Myset.NJELeftShoulderSwitch_Developer;
                    tbNJELeftShoulderMin.Visible = PublicSet.Myset.NJELeftShoulderSwitch_Developer;
                    tbNJELeftShoulderName.Visible = PublicSet.Myset.NJELeftShoulderSwitch_Developer;
                    tbNJELeftShoulderCompensate.Visible = PublicSet.Myset.NJELeftShoulderSwitch_Developer;
                    //右肩宽
                    if (PublicSet.Myset.NJERightShoulderSwitch_Developer) ++count;
                    lNJERightShoulder.Visible = PublicSet.Myset.NJERightShoulderSwitch_Developer;
                    cbNJERightShoulderSwitch.Visible = PublicSet.Myset.NJERightShoulderSwitch_Developer;
                    tbNJERightShoulderStandard.Visible = PublicSet.Myset.NJERightShoulderSwitch_Developer;
                    tbNJERightShoulderMax.Visible = PublicSet.Myset.NJERightShoulderSwitch_Developer;
                    tbNJERightShoulderMin.Visible = PublicSet.Myset.NJERightShoulderSwitch_Developer;
                    tbNJERightShoulderName.Visible = PublicSet.Myset.NJERightShoulderSwitch_Developer;
                    tbNJERightShoulderCompensate.Visible = PublicSet.Myset.NJERightShoulderSwitch_Developer;
                    //极耳宽
                    if (PublicSet.Myset.NJEWidthSwitch_Developer) ++count;
                    lNJEWidth.Visible = PublicSet.Myset.NJEWidthSwitch_Developer;
                    cbNJEWidthSwitch.Visible = PublicSet.Myset.NJEWidthSwitch_Developer;
                    tbNJEWidthStandard.Visible = PublicSet.Myset.NJEWidthSwitch_Developer;
                    tbNJEWidthMax.Visible = PublicSet.Myset.NJEWidthSwitch_Developer;
                    tbNJEWidthMin.Visible = PublicSet.Myset.NJEWidthSwitch_Developer;
                    tbNJEWidthName.Visible = PublicSet.Myset.NJEWidthSwitch_Developer;
                    tbNJEWidthCompensate.Visible = PublicSet.Myset.NJEWidthSwitch_Developer;
                    //极耳高
                    if (PublicSet.Myset.NJEHeightSwitch_Developer) ++count;
                    lNJEHeight.Visible = PublicSet.Myset.NJEHeightSwitch_Developer;
                    cbNJEHeightSwitch.Visible = PublicSet.Myset.NJEHeightSwitch_Developer;
                    tbNJEHeightStandard.Visible = PublicSet.Myset.NJEHeightSwitch_Developer;
                    tbNJEHeightMax.Visible = PublicSet.Myset.NJEHeightSwitch_Developer;
                    tbNJEHeightMin.Visible = PublicSet.Myset.NJEHeightSwitch_Developer;
                    tbNJEHeightName.Visible = PublicSet.Myset.NJEHeightSwitch_Developer;
                    tbNJEHeightCompensate.Visible = PublicSet.Myset.NJEHeightSwitch_Developer;
                    //带料高
                    if (PublicSet.Myset.NDLHeightSwitch_Developer) ++count;
                    lNDLHeight.Visible = PublicSet.Myset.NDLHeightSwitch_Developer;
                    cbNDLHeightSwitch.Visible = PublicSet.Myset.NDLHeightSwitch_Developer;
                    tbNDLHeightStandard.Visible = PublicSet.Myset.NDLHeightSwitch_Developer;
                    tbNDLHeightMax.Visible = PublicSet.Myset.NDLHeightSwitch_Developer;
                    tbNDLHeightMin.Visible = PublicSet.Myset.NDLHeightSwitch_Developer;
                    tbNDLHeightName.Visible = PublicSet.Myset.NDLHeightSwitch_Developer;
                    tbNDLHeightCompensate.Visible = PublicSet.Myset.NDLHeightSwitch_Developer;
                    //总宽
                    if (PublicSet.Myset.NJPTotalWidthSwitch_Developer) ++count;
                    lNJPTotalWidth.Visible = PublicSet.Myset.NJPTotalWidthSwitch_Developer;
                    cbNJPTotalWidthSwitch.Visible = PublicSet.Myset.NJPTotalWidthSwitch_Developer;
                    tbNJPTotalWidthStandard.Visible = PublicSet.Myset.NJPTotalWidthSwitch_Developer;
                    tbNJPTotalWidthMax.Visible = PublicSet.Myset.NJPTotalWidthSwitch_Developer;
                    tbNJPTotalWidthMin.Visible = PublicSet.Myset.NJPTotalWidthSwitch_Developer;
                    tbNJPTotalWidthName.Visible = PublicSet.Myset.NJPTotalWidthSwitch_Developer;
                    tbNJPTotalWidthCompensate.Visible = PublicSet.Myset.NJPTotalWidthSwitch_Developer;
                    //涂布高
                    if (PublicSet.Myset.NJPCoatingSwitch_Developer) ++count;
                    lNJPCoating.Visible = PublicSet.Myset.NJPCoatingSwitch_Developer;
                    cbNJPCoatingSwitch.Visible = PublicSet.Myset.NJPCoatingSwitch_Developer;
                    tbNJPCoatingStandard.Visible = PublicSet.Myset.NJPCoatingSwitch_Developer;
                    tbNJPCoatingMax.Visible = PublicSet.Myset.NJPCoatingSwitch_Developer;
                    tbNJPCoatingMin.Visible = PublicSet.Myset.NJPCoatingSwitch_Developer;
                    tbNJPCoatingName.Visible = PublicSet.Myset.NJPCoatingSwitch_Developer;
                    tbNJPCoatingCompensate.Visible = PublicSet.Myset.NJPCoatingSwitch_Developer;
                    //对角线
                    if (PublicSet.Myset.NDiagonalSwitch_Developer) ++count;
                    lNDiagonal.Visible = PublicSet.Myset.NDiagonalSwitch_Developer;
                    cbNDiagonalSwitch.Visible = PublicSet.Myset.NDiagonalSwitch_Developer;
                    tbNDiagonalStandard.Visible = PublicSet.Myset.NDiagonalSwitch_Developer;
                    tbNDiagonalMax.Visible = PublicSet.Myset.NDiagonalSwitch_Developer;
                    tbNDiagonalMin.Visible = PublicSet.Myset.NDiagonalSwitch_Developer;
                    tbNDiagonalName.Visible = PublicSet.Myset.NDiagonalSwitch_Developer;
                    tbNDiagonalCompensate.Visible = PublicSet.Myset.NDiagonalSwitch_Developer;
                    //左上垂直角度
                    if (PublicSet.Myset.NLeftUpAngleSwitch_Developer) ++count;
                    lNLeftUpAngle.Visible = PublicSet.Myset.NLeftUpAngleSwitch_Developer;
                    cbNLeftUpAngleSwitch.Visible = PublicSet.Myset.NLeftUpAngleSwitch_Developer;
                    tbNLeftUpAngleStandard.Visible = PublicSet.Myset.NLeftUpAngleSwitch_Developer;
                    tbNLeftUpAngleMax.Visible = PublicSet.Myset.NLeftUpAngleSwitch_Developer;
                    tbNLeftUpAngleMin.Visible = PublicSet.Myset.NLeftUpAngleSwitch_Developer;
                    tbNLeftUpAngleName.Visible = PublicSet.Myset.NLeftUpAngleSwitch_Developer;
                    tbNLeftUpAngleCompensate.Visible = PublicSet.Myset.NLeftUpAngleSwitch_Developer;
                    //右上垂直角度
                    if (PublicSet.Myset.NRightUpAngleSwitch_Developer) ++count;
                    lNRightUpAngle.Visible = PublicSet.Myset.NRightUpAngleSwitch_Developer;
                    cbNRightUpAngleSwitch.Visible = PublicSet.Myset.NRightUpAngleSwitch_Developer;
                    tbNRightUpAngleStandard.Visible = PublicSet.Myset.NRightUpAngleSwitch_Developer;
                    tbNRightUpAngleMax.Visible = PublicSet.Myset.NRightUpAngleSwitch_Developer;
                    tbNRightUpAngleMin.Visible = PublicSet.Myset.NRightUpAngleSwitch_Developer;
                    tbNRightUpAngleName.Visible = PublicSet.Myset.NRightUpAngleSwitch_Developer;
                    tbNRightUpAngleCompensate.Visible = PublicSet.Myset.NRightUpAngleSwitch_Developer;
                    //左下垂直角度
                    if (PublicSet.Myset.NLeftDownAngleSwitch_Developer) ++count;
                    lNLeftDownAngle.Visible = PublicSet.Myset.NLeftDownAngleSwitch_Developer;
                    cbNLeftDownAngleSwitch.Visible = PublicSet.Myset.NLeftDownAngleSwitch_Developer;
                    tbNLeftDownAngleStandard.Visible = PublicSet.Myset.NLeftDownAngleSwitch_Developer;
                    tbNLeftDownAngleMax.Visible = PublicSet.Myset.NLeftDownAngleSwitch_Developer;
                    tbNLeftDownAngleMin.Visible = PublicSet.Myset.NLeftDownAngleSwitch_Developer;
                    tbNLeftDownAngleName.Visible = PublicSet.Myset.NLeftDownAngleSwitch_Developer;
                    tbNLeftDownAngleCompensate.Visible = PublicSet.Myset.NLeftDownAngleSwitch_Developer;
                    //右下垂直角度
                    if (PublicSet.Myset.NRightDownAngleSwitch_Developer) ++count;
                    lNRightDownAngle.Visible = PublicSet.Myset.NRightDownAngleSwitch_Developer;
                    cbNRightDownAngleSwitch.Visible = PublicSet.Myset.NRightDownAngleSwitch_Developer; ;
                    tbNRightDownAngleStandard.Visible = PublicSet.Myset.NRightDownAngleSwitch_Developer;
                    tbNRightDownAngleMax.Visible = PublicSet.Myset.NRightDownAngleSwitch_Developer;
                    tbNRightDownAngleMin.Visible = PublicSet.Myset.NRightDownAngleSwitch_Developer;
                    tbNRightDownAngleName.Visible = PublicSet.Myset.NRightDownAngleSwitch_Developer;
                    tbNRightDownAngleCompensate.Visible = PublicSet.Myset.NRightDownAngleSwitch_Developer;
                    //mark点
                    if (PublicSet.Myset.NMarkSwitch_Developer) ++count;
                    lNMark.Visible = PublicSet.Myset.NMarkSwitch_Developer;
                    cbNMarkSwitch.Visible = PublicSet.Myset.NMarkSwitch_Developer;
                    tbNMarkStandard.Visible = false;
                    tbNMarkMin.Visible = PublicSet.Myset.NMarkSwitch_Developer;
                    tbNMarkMax.Visible = PublicSet.Myset.NMarkSwitch_Developer;
                    tbNMarkName.Visible = false;
                    tbNMarkCompensate.Visible = false;
                    radioButton3.Visible = count == 0 ? false : true;
                    #endregion

                    #region 负极V角工艺
                    count = 0;
                    if (PublicSet.Myset.NLeftUpVAngleSwitch_Developer) ++count;
                    lNLeftUpVAngle.Visible = PublicSet.Myset.NLeftUpVAngleSwitch_Developer;
                    tbNLeftUpVAngleMin.Visible = PublicSet.Myset.NLeftUpVAngleSwitch_Developer;
                    tbNLeftUpVAngleMax.Visible = PublicSet.Myset.NLeftUpVAngleSwitch_Developer;
                    tbNLeftUpVAngleStandard.Visible = PublicSet.Myset.NLeftUpVAngleSwitch_Developer;
                    cbNLeftUpVAngleSwitch.Visible = PublicSet.Myset.NLeftUpVAngleSwitch_Developer;
                    tbNLeftUpVAngleName.Visible = PublicSet.Myset.NLeftUpVAngleSwitch_Developer;
                    tbNLeftUpVAngleCompensate.Visible = PublicSet.Myset.NLeftUpVAngleSwitch_Developer;

                    if (PublicSet.Myset.NLeftUpVWidthSwitch_Developer) ++count;
                    lNLeftUpVWidth.Visible = PublicSet.Myset.NLeftUpVWidthSwitch_Developer;
                    tbNLeftUpVWidthMin.Visible = PublicSet.Myset.NLeftUpVWidthSwitch_Developer;
                    tbNLeftUpVWidthMax.Visible = PublicSet.Myset.NLeftUpVWidthSwitch_Developer;
                    tbNLeftUpVWidthStandard.Visible = PublicSet.Myset.NLeftUpVWidthSwitch_Developer;
                    cbNLeftUpVWidthSwitch.Visible = PublicSet.Myset.NLeftUpVWidthSwitch_Developer;
                    tbNLeftUpVWidthName.Visible = PublicSet.Myset.NLeftUpVWidthSwitch_Developer;
                    tbNLeftUpVWidthCompensate.Visible = PublicSet.Myset.NLeftUpVWidthSwitch_Developer;

                    if (PublicSet.Myset.NLeftUpVDepthSwitch_Developer) ++count;
                    lNLeftUpVDepth.Visible = PublicSet.Myset.NLeftUpVDepthSwitch_Developer;
                    tbNLeftUpVDepthMin.Visible = PublicSet.Myset.NLeftUpVDepthSwitch_Developer;
                    tbNLeftUpVDepthMax.Visible = PublicSet.Myset.NLeftUpVDepthSwitch_Developer;
                    tbNLeftUpVDepthStandard.Visible = PublicSet.Myset.NLeftUpVDepthSwitch_Developer;
                    cbNLeftUpVDepthSwitch.Visible = PublicSet.Myset.NLeftUpVDepthSwitch_Developer;
                    tbNLeftUpVDepthName.Visible = PublicSet.Myset.NLeftUpVDepthSwitch_Developer;
                    tbNLeftUpVDepthCompensate.Visible = PublicSet.Myset.NLeftUpVDepthSwitch_Developer;

                    if (PublicSet.Myset.NRightUpVAngleSwitch_Developer) ++count;
                    lNRightUpVAngle.Visible = PublicSet.Myset.NRightUpVAngleSwitch_Developer;
                    tbNRightUpVAngleMin.Visible = PublicSet.Myset.NRightUpVAngleSwitch_Developer;
                    tbNRightUpVAngleMax.Visible = PublicSet.Myset.NRightUpVAngleSwitch_Developer;
                    tbNRightUpVAngleStandard.Visible = PublicSet.Myset.NRightUpVAngleSwitch_Developer;
                    cbNRightUpVAngleSwitch.Visible = PublicSet.Myset.NRightUpVAngleSwitch_Developer;
                    tbNRightUpVAngleName.Visible = PublicSet.Myset.NRightUpVAngleSwitch_Developer;
                    tbNRightUpVAngleCompensate.Visible = PublicSet.Myset.NRightUpVAngleSwitch_Developer;


                    if (PublicSet.Myset.NRightUpVWidthSwitch_Developer) ++count;
                    lNRightUpVWidth.Visible = PublicSet.Myset.NRightUpVWidthSwitch_Developer;
                    tbNRightUpVWidthMin.Visible = PublicSet.Myset.NRightUpVWidthSwitch_Developer;
                    tbNRightUpVWidthMax.Visible = PublicSet.Myset.NRightUpVWidthSwitch_Developer;
                    tbNRightUpVWidthStandard.Visible = PublicSet.Myset.NRightUpVWidthSwitch_Developer;
                    cbNRightUpVWidthSwitch.Visible = PublicSet.Myset.NRightUpVWidthSwitch_Developer;
                    tbNRightUpVWidthName.Visible = PublicSet.Myset.NRightUpVWidthSwitch_Developer;
                    tbNRightUpVWidthCompensate.Visible = PublicSet.Myset.NRightUpVWidthSwitch_Developer;

                    if (PublicSet.Myset.NRightUpVDepthSwitch_Developer) ++count;
                    lNRightUpVDepth.Visible = PublicSet.Myset.NRightUpVDepthSwitch_Developer;
                    tbNRightUpVDepthMin.Visible = PublicSet.Myset.NRightUpVDepthSwitch_Developer;
                    tbNRightUpVDepthMax.Visible = PublicSet.Myset.NRightUpVDepthSwitch_Developer;
                    tbNRightUpVDepthStandard.Visible = PublicSet.Myset.NRightUpVDepthSwitch_Developer;
                    cbNRightUpVDepthSwitch.Visible = PublicSet.Myset.NRightUpVDepthSwitch_Developer;
                    tbNRightUpVDepthName.Visible = PublicSet.Myset.NRightUpVDepthSwitch_Developer;
                    tbNRightUpVDepthCompensate.Visible = PublicSet.Myset.NRightUpVDepthSwitch_Developer;

                    if (PublicSet.Myset.NLeftDownVAngleSwitch_Developer) ++count;
                    lNLeftDownVAngle.Visible = PublicSet.Myset.NLeftDownVAngleSwitch_Developer;
                    tbNLeftDownVAngleMin.Visible = PublicSet.Myset.NLeftDownVAngleSwitch_Developer;
                    tbNLeftDownVAngleMax.Visible = PublicSet.Myset.NLeftDownVAngleSwitch_Developer;
                    tbNLeftDownVAngleStandard.Visible = PublicSet.Myset.NLeftDownVAngleSwitch_Developer;
                    cbNLeftDownVAngleSwitch.Visible = PublicSet.Myset.NLeftDownVAngleSwitch_Developer;
                    tbNLeftDownVAngleName.Visible = PublicSet.Myset.NLeftDownVAngleSwitch_Developer;
                    tbNLeftDownVAngleCompensate.Visible = PublicSet.Myset.NLeftDownVAngleSwitch_Developer;

                    if (PublicSet.Myset.NLeftDownVWidthSwitch_Developer) ++count;
                    lNLeftDownVWidth.Visible = PublicSet.Myset.NLeftDownVWidthSwitch_Developer;
                    tbNLeftDownVWidthMin.Visible = PublicSet.Myset.NLeftDownVWidthSwitch_Developer;
                    tbNLeftDownVWidthMax.Visible = PublicSet.Myset.NLeftDownVWidthSwitch_Developer;
                    tbNLeftDownVWidthStandard.Visible = PublicSet.Myset.NLeftDownVWidthSwitch_Developer;
                    cbNLeftDownVWidthSwitch.Visible = PublicSet.Myset.NLeftDownVWidthSwitch_Developer;
                    tbNLeftDownVWidthName.Visible = PublicSet.Myset.NLeftDownVWidthSwitch_Developer;
                    tbNLeftDownVWidthCompensate.Visible = PublicSet.Myset.NLeftDownVWidthSwitch_Developer;

                    if (PublicSet.Myset.NLeftDownVDepthSwitch_Developer) ++count;
                    lNLeftDownVDepth.Visible = PublicSet.Myset.NLeftDownVDepthSwitch_Developer;
                    tbNLeftDownVDepthMin.Visible = PublicSet.Myset.NLeftDownVDepthSwitch_Developer;
                    tbNLeftDownVDepthMax.Visible = PublicSet.Myset.NLeftDownVDepthSwitch_Developer;
                    tbNLeftDownVDepthStandard.Visible = PublicSet.Myset.NLeftDownVDepthSwitch_Developer;
                    cbNLeftDownVDepthSwitch.Visible = PublicSet.Myset.NLeftDownVDepthSwitch_Developer;
                    tbNLeftDownVDepthName.Visible = PublicSet.Myset.NLeftDownVDepthSwitch_Developer;
                    tbNLeftDownVDepthCompensate.Visible = PublicSet.Myset.NLeftDownVDepthSwitch_Developer;

                    if (PublicSet.Myset.NRightDownVAngleSwitch_Developer) ++count;
                    lNRightDownVAngle.Visible = PublicSet.Myset.NRightDownVAngleSwitch_Developer;
                    tbNRightDownVAngleMin.Visible = PublicSet.Myset.NRightDownVAngleSwitch_Developer;
                    tbNRightDownVAngleMax.Visible = PublicSet.Myset.NRightDownVAngleSwitch_Developer;
                    tbNRightDownVAngleStandard.Visible = PublicSet.Myset.NRightDownVAngleSwitch_Developer;
                    cbNRightDownVAngleSwitch.Visible = PublicSet.Myset.NRightDownVAngleSwitch_Developer;
                    tbNRightDownVAngleName.Visible = PublicSet.Myset.NRightDownVAngleSwitch_Developer;
                    tbNRightDownVAngleCompensate.Visible = PublicSet.Myset.NRightDownVAngleSwitch_Developer;

                    if (PublicSet.Myset.NRightDownVWidthSwitch_Developer) ++count;
                    lNRightDownVWidth.Visible = PublicSet.Myset.NRightDownVWidthSwitch_Developer;
                    tbNRightDownVWidthMin.Visible = PublicSet.Myset.NRightDownVWidthSwitch_Developer;
                    tbNRightDownVWidthMax.Visible = PublicSet.Myset.NRightDownVWidthSwitch_Developer;
                    tbNRightDownVWidthStandard.Visible = PublicSet.Myset.NRightDownVWidthSwitch_Developer;
                    cbNRightDownVWidthSwitch.Visible = PublicSet.Myset.NRightDownVWidthSwitch_Developer;
                    tbNRightDownVWidthName.Visible = PublicSet.Myset.NRightDownVWidthSwitch_Developer;
                    tbNRightDownVWidthCompensate.Visible = PublicSet.Myset.NRightDownVWidthSwitch_Developer;

                    if (PublicSet.Myset.NRightDownVDepthSwitch_Developer) ++count;
                    lNRightDownVDepth.Visible = PublicSet.Myset.NRightDownVDepthSwitch_Developer;
                    tbNRightDownVDepthMin.Visible = PublicSet.Myset.NRightDownVDepthSwitch_Developer;
                    tbNRightDownVDepthMax.Visible = PublicSet.Myset.NRightDownVDepthSwitch_Developer;
                    tbNRightDownVDepthStandard.Visible = PublicSet.Myset.NRightDownVDepthSwitch_Developer;
                    cbNRightDownVDepthSwitch.Visible = PublicSet.Myset.NRightDownVDepthSwitch_Developer;
                    tbNRightDownVDepthName.Visible = PublicSet.Myset.NRightDownVDepthSwitch_Developer;
                    tbNRightDownVDepthCompensate.Visible = PublicSet.Myset.NRightDownVDepthSwitch_Developer;
                    radioButton4.Visible = count == 0 ? false : true;
                    #endregion

                    #region 正极工艺
                    count = 0;
                    //极片头宽
                    if (PublicSet.Myset.PJPHeadWidthSwitch_Developer) ++count;
                    lPJPHeadWidth.Visible = PublicSet.Myset.PJPHeadWidthSwitch_Developer;
                    cbPJPHeadWidthSwitch.Visible = PublicSet.Myset.PJPHeadWidthSwitch_Developer;
                    tbPJPHeadWidthStandard.Visible = PublicSet.Myset.PJPHeadWidthSwitch_Developer;
                    tbPJPHeadWidthMax.Visible = PublicSet.Myset.PJPHeadWidthSwitch_Developer;
                    tbPJPHeadWidthMin.Visible = PublicSet.Myset.PJPHeadWidthSwitch_Developer;
                    tbPJPHeadWidthName.Visible = PublicSet.Myset.PJPHeadWidthSwitch_Developer;
                    tbPJPHeadWidthCompensate.Visible = PublicSet.Myset.PJPHeadWidthSwitch_Developer;
                    //极片尾宽
                    if (PublicSet.Myset.PJPTailWidthSwitch_Developer) ++count;
                    lPJPTailWidth.Visible = PublicSet.Myset.PJPTailWidthSwitch_Developer;
                    cbPJPTailWidthSwitch.Visible = PublicSet.Myset.PJPTailWidthSwitch_Developer;
                    tbPJPTailWidthStandard.Visible = PublicSet.Myset.PJPTailWidthSwitch_Developer;
                    tbPJPTailWidthMax.Visible = PublicSet.Myset.PJPTailWidthSwitch_Developer;
                    tbPJPTailWidthMin.Visible = PublicSet.Myset.PJPTailWidthSwitch_Developer;
                    tbPJPTailWidthName.Visible = PublicSet.Myset.PJPTailWidthSwitch_Developer;
                    tbPJPTailWidthCompensate.Visible = PublicSet.Myset.PJPTailWidthSwitch_Developer;
                    //极片头长
                    if (PublicSet.Myset.PJPHeadLengthSwitch_Developer) ++count;
                    lPJPHeadLength.Visible = PublicSet.Myset.PJPHeadLengthSwitch_Developer;
                    cbPJPHeadLengthSwitch.Visible = PublicSet.Myset.PJPHeadLengthSwitch_Developer;
                    tbPJPHeadLengthStandard.Visible = PublicSet.Myset.PJPHeadLengthSwitch_Developer;
                    tbPJPHeadLengthMax.Visible = PublicSet.Myset.PJPHeadLengthSwitch_Developer;
                    tbPJPHeadLengthMin.Visible = PublicSet.Myset.PJPHeadLengthSwitch_Developer;
                    tbPJPHeadLengthName.Visible = PublicSet.Myset.PJPHeadLengthSwitch_Developer;
                    tbPJPHeadLengthCompensate.Visible = PublicSet.Myset.PJPHeadLengthSwitch_Developer;
                    //极片尾长
                    if (PublicSet.Myset.PJPTailLengthSwitch_Developer) ++count;
                    lPJPTailLength.Visible = PublicSet.Myset.PJPTailLengthSwitch_Developer;
                    cbPJPTailLengthSwitch.Visible = PublicSet.Myset.PJPTailLengthSwitch_Developer;
                    tbPJPTailLengthStandard.Visible = PublicSet.Myset.PJPTailLengthSwitch_Developer;
                    tbPJPTailLengthMax.Visible = PublicSet.Myset.PJPTailLengthSwitch_Developer;
                    tbPJPTailLengthMin.Visible = PublicSet.Myset.PJPTailLengthSwitch_Developer;
                    tbPJPTailLengthName.Visible = PublicSet.Myset.PJPTailLengthSwitch_Developer;
                    tbPJPTailLengthCompensate.Visible = PublicSet.Myset.PJPTailLengthSwitch_Developer;
                    //左肩宽
                    if (PublicSet.Myset.PJELeftShoulderSwitch_Developer) ++count;
                    lPJELeftShoulder.Visible = PublicSet.Myset.PJELeftShoulderSwitch_Developer;
                    cbPJELeftShoulderSwitch.Visible = PublicSet.Myset.PJELeftShoulderSwitch_Developer;
                    tbPJELeftShoulderStandard.Visible = PublicSet.Myset.PJELeftShoulderSwitch_Developer;
                    tbPJELeftShoulderMax.Visible = PublicSet.Myset.PJELeftShoulderSwitch_Developer;
                    tbPJELeftShoulderMin.Visible = PublicSet.Myset.PJELeftShoulderSwitch_Developer;
                    tbPJELeftShoulderName.Visible = PublicSet.Myset.PJELeftShoulderSwitch_Developer;
                    tbPJELeftShoulderCompensate.Visible = PublicSet.Myset.PJELeftShoulderSwitch_Developer;
                    //右肩宽
                    if (PublicSet.Myset.PJERightShoulderSwitch_Developer) ++count;
                    lPJERightShoulder.Visible = PublicSet.Myset.PJERightShoulderSwitch_Developer;
                    cbPJERightShoulderSwitch.Visible = PublicSet.Myset.PJERightShoulderSwitch_Developer;
                    tbPJERightShoulderStandard.Visible = PublicSet.Myset.PJERightShoulderSwitch_Developer;
                    tbPJERightShoulderMax.Visible = PublicSet.Myset.PJERightShoulderSwitch_Developer;
                    tbPJERightShoulderMin.Visible = PublicSet.Myset.PJERightShoulderSwitch_Developer;
                    tbPJERightShoulderName.Visible = PublicSet.Myset.PJERightShoulderSwitch_Developer;
                    tbPJERightShoulderCompensate.Visible = PublicSet.Myset.PJERightShoulderSwitch_Developer;
                    //极耳宽
                    if (PublicSet.Myset.PJEWidthSwitch_Developer) ++count;
                    lPJEWidth.Visible = PublicSet.Myset.PJEWidthSwitch_Developer;
                    cbPJEWidthSwitch.Visible = PublicSet.Myset.PJEWidthSwitch_Developer;
                    tbPJEWidthStandard.Visible = PublicSet.Myset.PJEWidthSwitch_Developer;
                    tbPJEWidthMax.Visible = PublicSet.Myset.PJEWidthSwitch_Developer;
                    tbPJEWidthMin.Visible = PublicSet.Myset.PJEWidthSwitch_Developer;
                    tbPJEWidthName.Visible = PublicSet.Myset.PJEWidthSwitch_Developer;
                    tbPJEWidthCompensate.Visible = PublicSet.Myset.PJEWidthSwitch_Developer;
                    //极耳高
                    if (PublicSet.Myset.PJEHeightSwitch_Developer) ++count;
                    lPJEHeight.Visible = PublicSet.Myset.PJEHeightSwitch_Developer;
                    cbPJEHeightSwitch.Visible = PublicSet.Myset.PJEHeightSwitch_Developer;
                    tbPJEHeightStandard.Visible = PublicSet.Myset.PJEHeightSwitch_Developer;
                    tbPJEHeightMax.Visible = PublicSet.Myset.PJEHeightSwitch_Developer;
                    tbPJEHeightMin.Visible = PublicSet.Myset.PJEHeightSwitch_Developer;
                    tbPJEHeightName.Visible = PublicSet.Myset.PJEHeightSwitch_Developer;
                    tbPJEHeightCompensate.Visible = PublicSet.Myset.PJEHeightSwitch_Developer;
                    //带料高
                    if (PublicSet.Myset.PCeramicHeightSwitch_Developer) ++count;
                    lPCeramicHeight.Visible = PublicSet.Myset.PCeramicHeightSwitch_Developer;
                    cbPCeramicHeightSwitch.Visible = PublicSet.Myset.PCeramicHeightSwitch_Developer;
                    tbPCeramicHeightStandard.Visible = PublicSet.Myset.PCeramicHeightSwitch_Developer;
                    tbPCeramicHeightMax.Visible = PublicSet.Myset.PCeramicHeightSwitch_Developer;
                    tbPCeramicHeightMin.Visible = PublicSet.Myset.PCeramicHeightSwitch_Developer;
                    tbPCeramicHeightName.Visible = PublicSet.Myset.PCeramicHeightSwitch_Developer;
                    tbPCeramicHeightCompensate.Visible = PublicSet.Myset.PCeramicHeightSwitch_Developer;
                    //总宽
                    if (PublicSet.Myset.PJPTotalWidthSwitch_Developer) ++count;
                    lPJPTotalWidth.Visible = PublicSet.Myset.PJPTotalWidthSwitch_Developer;
                    cbPJPTotalWidthSwitch.Visible = PublicSet.Myset.PJPTotalWidthSwitch_Developer;
                    tbPJPTotalWidthStandard.Visible = PublicSet.Myset.PJPTotalWidthSwitch_Developer;
                    tbPJPTotalWidthMax.Visible = PublicSet.Myset.PJPTotalWidthSwitch_Developer;
                    tbPJPTotalWidthMin.Visible = PublicSet.Myset.PJPTotalWidthSwitch_Developer;
                    tbPJPTotalWidthName.Visible = PublicSet.Myset.PJPTotalWidthSwitch_Developer;
                    tbPJPTotalWidthCompensate.Visible = PublicSet.Myset.PJPTotalWidthSwitch_Developer;
                    //涂布高
                    if (PublicSet.Myset.PJPCoatingSwitch_Developer) ++count;
                    lPJPCoating.Visible = PublicSet.Myset.PJPCoatingSwitch_Developer;
                    cbPJPCoatingSwitch.Visible = PublicSet.Myset.PJPCoatingSwitch_Developer;
                    tbPJPCoatingStandard.Visible = PublicSet.Myset.PJPCoatingSwitch_Developer;
                    tbPJPCoatingMax.Visible = PublicSet.Myset.PJPCoatingSwitch_Developer;
                    tbPJPCoatingMin.Visible = PublicSet.Myset.PJPCoatingSwitch_Developer;
                    tbPJPCoatingName.Visible = PublicSet.Myset.PJPCoatingSwitch_Developer;
                    tbPJPCoatingCompensate.Visible = PublicSet.Myset.PJPCoatingSwitch_Developer;
                    //对角线
                    if (PublicSet.Myset.PDiagonalSwitch_Developer) ++count;
                    lPDiagonal.Visible = PublicSet.Myset.PDiagonalSwitch_Developer;
                    cbPDiagonalSwitch.Visible = PublicSet.Myset.PDiagonalSwitch_Developer;
                    tbPDiagonalStandard.Visible = PublicSet.Myset.PDiagonalSwitch_Developer;
                    tbPDiagonalMax.Visible = PublicSet.Myset.PDiagonalSwitch_Developer;
                    tbPDiagonalMin.Visible = PublicSet.Myset.PDiagonalSwitch_Developer;
                    tbPDiagonalName.Visible = PublicSet.Myset.PDiagonalSwitch_Developer;
                    tbPDiagonalCompensate.Visible = PublicSet.Myset.PDiagonalSwitch_Developer;
                    //左上垂直角度
                    if (PublicSet.Myset.PLeftUpAngleSwitch_Developer) ++count;
                    lPLeftUpAngle.Visible = PublicSet.Myset.PLeftUpAngleSwitch_Developer;
                    cbPLeftUpAngleSwitch.Visible = PublicSet.Myset.PLeftUpAngleSwitch_Developer;
                    tbPLeftUpAngleStandard.Visible = PublicSet.Myset.PLeftUpAngleSwitch_Developer;
                    tbPLeftUpAngleMax.Visible = PublicSet.Myset.PLeftUpAngleSwitch_Developer;
                    tbPLeftUpAngleMin.Visible = PublicSet.Myset.PLeftUpAngleSwitch_Developer;
                    tbPLeftUpAngleName.Visible = PublicSet.Myset.PLeftUpAngleSwitch_Developer;
                    tbPLeftUpAngleCompensate.Visible = PublicSet.Myset.PLeftUpAngleSwitch_Developer;
                    //右上垂直角度
                    if (PublicSet.Myset.PRightUpAngleSwitch_Developer) ++count;
                    lPRightUpAngle.Visible = PublicSet.Myset.PRightUpAngleSwitch_Developer;
                    cbPRightUpAngleSwitch.Visible = PublicSet.Myset.PRightUpAngleSwitch_Developer;
                    tbPRightUpAngleStandard.Visible = PublicSet.Myset.PRightUpAngleSwitch_Developer;
                    tbPRightUpAngleMax.Visible = PublicSet.Myset.PRightUpAngleSwitch_Developer;
                    tbPRightUpAngleMin.Visible = PublicSet.Myset.PRightUpAngleSwitch_Developer;
                    tbPRightUpAngleName.Visible = PublicSet.Myset.PRightUpAngleSwitch_Developer;
                    tbPRightUpAngleCompensate.Visible = PublicSet.Myset.PRightUpAngleSwitch_Developer;
                    //左下垂直角度
                    if (PublicSet.Myset.PLeftDownAngleSwitch_Developer) ++count;
                    lPLeftDownAngle.Visible = PublicSet.Myset.PLeftDownAngleSwitch_Developer;
                    cbPLeftDownAngleSwitch.Visible = PublicSet.Myset.PLeftDownAngleSwitch_Developer;
                    tbPLeftDownAngleStandard.Visible = PublicSet.Myset.PLeftDownAngleSwitch_Developer;
                    tbPLeftDownAngleMax.Visible = PublicSet.Myset.PLeftDownAngleSwitch_Developer;
                    tbPLeftDownAngleMin.Visible = PublicSet.Myset.PLeftDownAngleSwitch_Developer;
                    tbPLeftDownAngleName.Visible = PublicSet.Myset.PLeftDownAngleSwitch_Developer;
                    tbPLeftDownAngleCompensate.Visible = PublicSet.Myset.PLeftDownAngleSwitch_Developer;
                    //右下垂直角度
                    if (PublicSet.Myset.PRightDownAngleSwitch_Developer) ++count;
                    lPRightDownAngle.Visible = PublicSet.Myset.PRightDownAngleSwitch_Developer;
                    cbPRightDownAngleSwitch.Visible = PublicSet.Myset.PRightDownAngleSwitch_Developer; ;
                    tbPRightDownAngleStandard.Visible = PublicSet.Myset.PRightDownAngleSwitch_Developer;
                    tbPRightDownAngleMax.Visible = PublicSet.Myset.PRightDownAngleSwitch_Developer;
                    tbPRightDownAngleMin.Visible = PublicSet.Myset.PRightDownAngleSwitch_Developer;
                    tbPRightDownAngleName.Visible = PublicSet.Myset.PRightDownAngleSwitch_Developer;
                    tbPRightDownAngleCompensate.Visible = PublicSet.Myset.PRightDownAngleSwitch_Developer;
                    //mark点
                    if (PublicSet.Myset.PMarkSwitch_Developer) ++count;
                    lPMark.Visible = PublicSet.Myset.PMarkSwitch_Developer;
                    cbPMarkSwitch.Visible = PublicSet.Myset.PMarkSwitch_Developer;
                    tbPMarkStandard.Visible = false;
                    tbPMarkMin.Visible = PublicSet.Myset.PMarkSwitch_Developer;
                    tbPMarkMax.Visible = PublicSet.Myset.PMarkSwitch_Developer;
                    tbPMarkName.Visible = false;
                    radioButton5.Visible = count == 0 ? false : true;
                    #endregion

                    #region 正极V角工艺
                    count = 0;
                    if (PublicSet.Myset.PLeftUpVAngleSwitch_Developer) ++count;
                    lPLeftUpVAngle.Visible = PublicSet.Myset.PLeftUpVAngleSwitch_Developer;
                    tbPLeftUpVAngleMin.Visible = PublicSet.Myset.PLeftUpVAngleSwitch_Developer;
                    tbPLeftUpVAngleMax.Visible = PublicSet.Myset.PLeftUpVAngleSwitch_Developer;
                    tbPLeftUpVAngleStandard.Visible = PublicSet.Myset.PLeftUpVAngleSwitch_Developer;
                    cbPLeftUpVAngleSwitch.Visible = PublicSet.Myset.PLeftUpVAngleSwitch_Developer;
                    tbPLeftUpVAngleName.Visible = PublicSet.Myset.PLeftUpVAngleSwitch_Developer;
                    tbPLeftUpVAngleCompensate.Visible = PublicSet.Myset.PLeftUpVAngleSwitch_Developer;

                    if (PublicSet.Myset.PLeftUpVWidthSwitch_Developer) ++count;
                    lPLeftUpVWidth.Visible = PublicSet.Myset.PLeftUpVWidthSwitch_Developer;
                    tbPLeftUpVWidthMin.Visible = PublicSet.Myset.PLeftUpVWidthSwitch_Developer;
                    tbPLeftUpVWidthMax.Visible = PublicSet.Myset.PLeftUpVWidthSwitch_Developer;
                    tbPLeftUpVWidthStandard.Visible = PublicSet.Myset.PLeftUpVWidthSwitch_Developer;
                    cbPLeftUpVWidthSwitch.Visible = PublicSet.Myset.PLeftUpVWidthSwitch_Developer;
                    tbPLeftUpVWidthName.Visible = PublicSet.Myset.PLeftUpVWidthSwitch_Developer;
                    tbPLeftUpVWidthCompensate.Visible = PublicSet.Myset.PLeftUpVWidthSwitch_Developer;

                    if (PublicSet.Myset.PLeftUpVDepthSwitch_Developer) ++count;
                    lPLeftUpVDepth.Visible = PublicSet.Myset.PLeftUpVDepthSwitch_Developer;
                    tbPLeftUpVDepthMin.Visible = PublicSet.Myset.PLeftUpVDepthSwitch_Developer;
                    tbPLeftUpVDepthMax.Visible = PublicSet.Myset.PLeftUpVDepthSwitch_Developer;
                    tbPLeftUpVDepthStandard.Visible = PublicSet.Myset.PLeftUpVDepthSwitch_Developer;
                    cbPLeftUpVDepthSwitch.Visible = PublicSet.Myset.PLeftUpVDepthSwitch_Developer;
                    tbPLeftUpVDepthName.Visible = PublicSet.Myset.PLeftUpVDepthSwitch_Developer;
                    tbPLeftUpVDepthCompensate.Visible = PublicSet.Myset.PLeftUpVDepthSwitch_Developer;

                    if (PublicSet.Myset.PRightUpVAngleSwitch_Developer) ++count;
                    lPRightUpVAngle.Visible = PublicSet.Myset.PRightUpVAngleSwitch_Developer;
                    tbPRightUpVAngleMin.Visible = PublicSet.Myset.PRightUpVAngleSwitch_Developer;
                    tbPRightUpVAngleMax.Visible = PublicSet.Myset.PRightUpVAngleSwitch_Developer;
                    tbPRightUpVAngleStandard.Visible = PublicSet.Myset.PRightUpVAngleSwitch_Developer;
                    cbPRightUpVAngleSwitch.Visible = PublicSet.Myset.PRightUpVAngleSwitch_Developer;
                    tbPRightUpVAngleName.Visible = PublicSet.Myset.PRightUpVAngleSwitch_Developer;
                    tbPRightUpVAngleCompensate.Visible = PublicSet.Myset.PRightUpVAngleSwitch_Developer;

                    if (PublicSet.Myset.PRightUpVWidthSwitch_Developer) ++count;
                    lPRightUpVWidth.Visible = PublicSet.Myset.PRightUpVWidthSwitch_Developer;
                    tbPRightUpVWidthMin.Visible = PublicSet.Myset.PRightUpVWidthSwitch_Developer;
                    tbPRightUpVWidthMax.Visible = PublicSet.Myset.PRightUpVWidthSwitch_Developer;
                    tbPRightUpVWidthStandard.Visible = PublicSet.Myset.PRightUpVWidthSwitch_Developer;
                    cbPRightUpVWidthSwitch.Visible = PublicSet.Myset.PRightUpVWidthSwitch_Developer;
                    tbPRightUpVWidthName.Visible = PublicSet.Myset.PRightUpVWidthSwitch_Developer;
                    tbPRightUpVWidthCompensate.Visible = PublicSet.Myset.PRightUpVWidthSwitch_Developer;

                    if (PublicSet.Myset.PRightUpVDepthSwitch_Developer) ++count;
                    lPRightUpVDepth.Visible = PublicSet.Myset.PRightUpVDepthSwitch_Developer;
                    tbPRightUpVDepthMin.Visible = PublicSet.Myset.PRightUpVDepthSwitch_Developer;
                    tbPRightUpVDepthMax.Visible = PublicSet.Myset.PRightUpVDepthSwitch_Developer;
                    tbPRightUpVDepthStandard.Visible = PublicSet.Myset.PRightUpVDepthSwitch_Developer;
                    cbPRightUpVDepthSwitch.Visible = PublicSet.Myset.PRightUpVDepthSwitch_Developer;
                    tbPRightUpVDepthName.Visible = PublicSet.Myset.PRightUpVDepthSwitch_Developer;
                    tbPRightUpVDepthCompensate.Visible = PublicSet.Myset.PRightUpVDepthSwitch_Developer;

                    if (PublicSet.Myset.PLeftDownVAngleSwitch_Developer) ++count;
                    lPLeftDownVAngle.Visible = PublicSet.Myset.PLeftDownVAngleSwitch_Developer;
                    tbPLeftDownVAngleMin.Visible = PublicSet.Myset.PLeftDownVAngleSwitch_Developer;
                    tbPLeftDownVAngleMax.Visible = PublicSet.Myset.PLeftDownVAngleSwitch_Developer;
                    tbPLeftDownVAngleStandard.Visible = PublicSet.Myset.PLeftDownVAngleSwitch_Developer;
                    cbPLeftDownVAngleSwitch.Visible = PublicSet.Myset.PLeftDownVAngleSwitch_Developer;
                    tbPLeftDownVAngleName.Visible = PublicSet.Myset.PLeftDownVAngleSwitch_Developer;
                    tbPLeftDownVAngleCompensate.Visible = PublicSet.Myset.PLeftDownVAngleSwitch_Developer;

                    if (PublicSet.Myset.PLeftDownVWidthSwitch_Developer) ++count;
                    lPLeftDownVWidth.Visible = PublicSet.Myset.PLeftDownVWidthSwitch_Developer;
                    tbPLeftDownVWidthMin.Visible = PublicSet.Myset.PLeftDownVWidthSwitch_Developer;
                    tbPLeftDownVWidthMax.Visible = PublicSet.Myset.PLeftDownVWidthSwitch_Developer;
                    tbPLeftDownVWidthStandard.Visible = PublicSet.Myset.PLeftDownVWidthSwitch_Developer;
                    cbPLeftDownVWidthSwitch.Visible = PublicSet.Myset.PLeftDownVWidthSwitch_Developer;
                    tbPLeftDownVWidthName.Visible = PublicSet.Myset.PLeftDownVWidthSwitch_Developer;
                    tbPLeftDownVWidthCompensate.Visible = PublicSet.Myset.PLeftDownVWidthSwitch_Developer;

                    if (PublicSet.Myset.PLeftDownVDepthSwitch_Developer) ++count;
                    lPLeftDownVDepth.Visible = PublicSet.Myset.PLeftDownVDepthSwitch_Developer;
                    tbPLeftDownVDepthMin.Visible = PublicSet.Myset.PLeftDownVDepthSwitch_Developer;
                    tbPLeftDownVDepthMax.Visible = PublicSet.Myset.PLeftDownVDepthSwitch_Developer;
                    tbPLeftDownVDepthStandard.Visible = PublicSet.Myset.PLeftDownVDepthSwitch_Developer;
                    cbPLeftDownVDepthSwitch.Visible = PublicSet.Myset.PLeftDownVDepthSwitch_Developer;
                    tbPLeftDownVDepthName.Visible = PublicSet.Myset.PLeftDownVDepthSwitch_Developer;
                    tbPLeftDownVDepthCompensate.Visible = PublicSet.Myset.PLeftDownVDepthSwitch_Developer;

                    if (PublicSet.Myset.PRightDownVAngleSwitch_Developer) ++count;
                    lPRightDownVAngle.Visible = PublicSet.Myset.PRightDownVAngleSwitch_Developer;
                    tbPRightDownVAngleMin.Visible = PublicSet.Myset.PRightDownVAngleSwitch_Developer;
                    tbPRightDownVAngleMax.Visible = PublicSet.Myset.PRightDownVAngleSwitch_Developer;
                    tbPRightDownVAngleStandard.Visible = PublicSet.Myset.PRightDownVAngleSwitch_Developer;
                    cbPRightDownVAngleSwitch.Visible = PublicSet.Myset.PRightDownVAngleSwitch_Developer;
                    tbPRightDownVAngleName.Visible = PublicSet.Myset.PRightDownVAngleSwitch_Developer;
                    tbPRightDownVAngleCompensate.Visible = PublicSet.Myset.PRightDownVAngleSwitch_Developer;

                    if (PublicSet.Myset.PRightDownVWidthSwitch_Developer) ++count;
                    lPRightDownVWidth.Visible = PublicSet.Myset.PRightDownVWidthSwitch_Developer;
                    tbPRightDownVWidthMin.Visible = PublicSet.Myset.PRightDownVWidthSwitch_Developer;
                    tbPRightDownVWidthMax.Visible = PublicSet.Myset.PRightDownVWidthSwitch_Developer;
                    tbPRightDownVWidthStandard.Visible = PublicSet.Myset.PRightDownVWidthSwitch_Developer;
                    cbPRightDownVWidthSwitch.Visible = PublicSet.Myset.PRightDownVWidthSwitch_Developer;
                    tbPRightDownVWidthName.Visible = PublicSet.Myset.PRightDownVWidthSwitch_Developer;
                    tbPRightDownVWidthCompensate.Visible = PublicSet.Myset.PRightDownVWidthSwitch_Developer;

                    if (PublicSet.Myset.PRightDownVDepthSwitch_Developer) ++count;
                    lPRightDownVDepth.Visible = PublicSet.Myset.PRightDownVDepthSwitch_Developer;
                    tbPRightDownVDepthMin.Visible = PublicSet.Myset.PRightDownVDepthSwitch_Developer;
                    tbPRightDownVDepthMax.Visible = PublicSet.Myset.PRightDownVDepthSwitch_Developer;
                    tbPRightDownVDepthStandard.Visible = PublicSet.Myset.PRightDownVDepthSwitch_Developer;
                    cbPRightDownVDepthSwitch.Visible = PublicSet.Myset.PRightDownVDepthSwitch_Developer;
                    tbPRightDownVDepthName.Visible = PublicSet.Myset.PRightDownVDepthSwitch_Developer;
                    tbPRightDownVDepthCompensate.Visible = PublicSet.Myset.PRightDownVDepthSwitch_Developer;
                    radioButton6.Visible = count == 0 ? false : true;

                    #endregion

                    #region  极耳打折
                    count = 0;
                    if (PublicSet.Myset.NJEBevelLimitSwitch_Developer) ++count;
                    if (PublicSet.Myset.PJEBevelLimitSwitch_Developer) ++count;
                    radioButton7.Visible = count == 0 ? false : true;
                    #endregion

                    #region  缺角
                    count = 0;
                    //负极左上
                    if (PublicSet.Myset.NLeftUpBevelSwitch_Developer) ++count;
                    lNLeftUpBevel.Visible = PublicSet.Myset.NLeftUpBevelSwitch_Developer;
                    tbNLeftUpBevelGrayMin.Visible = PublicSet.Myset.NLeftUpBevelSwitch_Developer;
                    tbNLeftUpBevelAreaMin.Visible = PublicSet.Myset.NLeftUpBevelSwitch_Developer;
                    tbNLeftUpBevelAreaMax.Visible = PublicSet.Myset.NLeftUpBevelSwitch_Developer;
                    tbNLeftUpBevelFrame.Visible = PublicSet.Myset.NLeftUpBevelSwitch_Developer;
                    cbNLeftUpBevelSwitch.Visible = PublicSet.Myset.NLeftUpBevelSwitch_Developer;
                    tbNLeftUpBevelName.Visible = PublicSet.Myset.NLeftUpBevelSwitch_Developer;
                    tbNLeftUpBevelCompensate.Visible = PublicSet.Myset.NLeftUpBevelSwitch_Developer;
                    //负极右上
                    if (PublicSet.Myset.NRightUpBevelSwitch_Developer) ++count;
                    lNRightUpBevel.Visible = PublicSet.Myset.NRightUpBevelSwitch_Developer;
                    tbNRightUpBevelGrayMin.Visible = PublicSet.Myset.NRightUpBevelSwitch_Developer;
                    tbNRightUpBevelAreaMin.Visible = PublicSet.Myset.NRightUpBevelSwitch_Developer;
                    tbNRightUpBevelAreaMax.Visible = PublicSet.Myset.NRightUpBevelSwitch_Developer;
                    tbNRightUpBevelFrame.Visible = PublicSet.Myset.NRightUpBevelSwitch_Developer;
                    cbNRightUpBevelSwitch.Visible = PublicSet.Myset.NRightUpBevelSwitch_Developer;
                    tbNRightUpBevelName.Visible = PublicSet.Myset.NRightUpBevelSwitch_Developer;
                    tbNRightUpBevelCompensate.Visible = PublicSet.Myset.NRightUpBevelSwitch_Developer;
                    //负极左下
                    if (PublicSet.Myset.NLeftDownBevelSwitch_Developer) ++count;
                    lNLeftDownBevel.Visible = PublicSet.Myset.NLeftDownBevelSwitch_Developer;
                    tbNLeftDownBevelGrayMin.Visible = PublicSet.Myset.NLeftDownBevelSwitch_Developer;
                    tbNLeftDownBevelAreaMin.Visible = PublicSet.Myset.NLeftDownBevelSwitch_Developer;
                    tbNLeftDownBevelAreaMax.Visible = PublicSet.Myset.NLeftDownBevelSwitch_Developer;
                    tbNLeftDownBevelFrame.Visible = PublicSet.Myset.NLeftDownBevelSwitch_Developer;
                    cbNLeftDownBevelSwitch.Visible = PublicSet.Myset.NLeftDownBevelSwitch_Developer;
                    tbNLeftDownBevelName.Visible = PublicSet.Myset.NLeftDownBevelSwitch_Developer;
                    tbNLeftDownBevelCompensate.Visible = PublicSet.Myset.NLeftDownBevelSwitch_Developer;
                    //负极右下
                    if (PublicSet.Myset.NRightDownBevelSwitch_Developer) ++count;
                    lNRightDownBevel.Visible = PublicSet.Myset.NRightDownBevelSwitch_Developer;
                    tbNRightDownBevelGrayMin.Visible = PublicSet.Myset.NRightDownBevelSwitch_Developer;
                    tbNRightDownBevelAreaMin.Visible = PublicSet.Myset.NRightDownBevelSwitch_Developer;
                    tbNRightDownBevelAreaMax.Visible = PublicSet.Myset.NRightDownBevelSwitch_Developer;
                    tbNRightDownBevelFrame.Visible = PublicSet.Myset.NRightDownBevelSwitch_Developer;
                    cbNRightDownBevelSwitch.Visible = PublicSet.Myset.NRightDownBevelSwitch_Developer;
                    tbNRightDownBevelName.Visible = PublicSet.Myset.NRightDownBevelSwitch_Developer;
                    tbNRightDownBevelCompensate.Visible = PublicSet.Myset.NRightDownBevelSwitch_Developer;
                    groupBox3.Visible = count == 0 ? false : true;

                    //正极左上
                    count1 = 0;
                    if (PublicSet.Myset.PLeftUpBevelSwitch_Developer) ++count1;
                    lPLeftUpBevel.Visible = PublicSet.Myset.PLeftUpBevelSwitch_Developer;
                    tbPLeftUpBevelGrayMin.Visible = PublicSet.Myset.PLeftUpBevelSwitch_Developer;
                    tbPLeftUpBevelAreaMin.Visible = PublicSet.Myset.PLeftUpBevelSwitch_Developer;
                    tbPLeftUpBevelAreaMax.Visible = PublicSet.Myset.PLeftUpBevelSwitch_Developer;
                    tbPLeftUpBevelFrame.Visible = PublicSet.Myset.PLeftUpBevelSwitch_Developer;
                    cbPLeftUpBevelSwitch.Visible = PublicSet.Myset.PLeftUpBevelSwitch_Developer;
                    tbPLeftUpBevelName.Visible = PublicSet.Myset.PLeftUpBevelSwitch_Developer;
                    tbPLeftUpBevelCompensate.Visible = PublicSet.Myset.PLeftUpBevelSwitch_Developer;
                    //正极右上
                    if (PublicSet.Myset.PRightUpBevelSwitch_Developer) ++count1;
                    lPRightUpBevel.Visible = PublicSet.Myset.PRightUpBevelSwitch_Developer;
                    tbPRightUpBevelGrayMin.Visible = PublicSet.Myset.PRightUpBevelSwitch_Developer;
                    tbPRightUpBevelAreaMin.Visible = PublicSet.Myset.PRightUpBevelSwitch_Developer;
                    tbPRightUpBevelAreaMax.Visible = PublicSet.Myset.PRightUpBevelSwitch_Developer;
                    tbPRightUpBevelFrame.Visible = PublicSet.Myset.PRightUpBevelSwitch_Developer;
                    cbPRightUpBevelSwitch.Visible = PublicSet.Myset.PRightUpBevelSwitch_Developer;
                    tbPRightUpBevelName.Visible = PublicSet.Myset.PRightUpBevelSwitch_Developer;
                    tbPRightUpBevelCompensate.Visible = PublicSet.Myset.PRightUpBevelSwitch_Developer;
                    //正极左下
                    if (PublicSet.Myset.PLeftDownBevelSwitch_Developer) ++count1;
                    lPLeftDownBevel.Visible = PublicSet.Myset.PLeftDownBevelSwitch_Developer;
                    tbPLeftDownBevelGrayMin.Visible = PublicSet.Myset.PLeftDownBevelSwitch_Developer;
                    tbPLeftDownBevelAreaMin.Visible = PublicSet.Myset.PLeftDownBevelSwitch_Developer;
                    tbPLeftDownBevelAreaMax.Visible = PublicSet.Myset.PLeftDownBevelSwitch_Developer;
                    tbPLeftDownBevelFrame.Visible = PublicSet.Myset.PLeftDownBevelSwitch_Developer;
                    cbPLeftDownBevelSwitch.Visible = PublicSet.Myset.PLeftDownBevelSwitch_Developer;
                    tbPLeftDownBevelName.Visible = PublicSet.Myset.PLeftDownBevelSwitch_Developer;
                    tbPLeftDownBevelCompensate.Visible = PublicSet.Myset.PLeftDownBevelSwitch_Developer;
                    //正极右下
                    if (PublicSet.Myset.PRightDownBevelSwitch_Developer) ++count1;
                    lPRightDownBevel.Visible = PublicSet.Myset.PRightDownBevelSwitch_Developer;
                    tbPRightDownBevelGrayMin.Visible = PublicSet.Myset.PRightDownBevelSwitch_Developer;
                    tbPRightDownBevelAreaMin.Visible = PublicSet.Myset.PRightDownBevelSwitch_Developer;
                    tbPRightDownBevelAreaMax.Visible = PublicSet.Myset.PRightDownBevelSwitch_Developer;
                    tbPRightDownBevelFrame.Visible = PublicSet.Myset.PRightDownBevelSwitch_Developer;
                    cbPRightDownBevelSwitch.Visible = PublicSet.Myset.PRightDownBevelSwitch_Developer;
                    tbPRightDownBevelName.Visible = PublicSet.Myset.PRightDownBevelSwitch_Developer;
                    tbPRightDownBevelCompensate.Visible = PublicSet.Myset.PRightDownBevelSwitch_Developer;
                    groupBox1.Visible = count1 == 0 ? false : true;
                    if (count == 0 && count1 == 0) radioButton8.Visible = false;
                    #endregion
                    //图标管理
                    gbicon.Visible = false;
                    radioButton11.Visible = false;//检测项优先级按钮
                    #region  系统设置 空片检测开关
                    cbNullSliceN.Visible = PublicSet.Myset.NullSliceN_Developer;
                    cbNullSliceP.Visible = PublicSet.Myset.NullSliceP_Developer;
                    cbTJ_Hour.Visible = false;
                    cbEarlyWarning.Visible = false;

                    cbSwipingCardLogin.Visible = PublicSet.Myset.SwipingCardLogin_Developer;
                    lLoginUserPower.Visible = tbLoginUserPower.Visible = lLoginUserName.Visible = tbLoginUserName.Visible = lLoginVerifyP.Visible = tbLoginVerifyP.Visible = lLoginVerifyN.Visible = tbLoginVerifyN.Visible = PublicSet.Myset.SwipingCardLogin_Developer;

                    #endregion
                }
                else
                {
                    //图标管理
                    gbicon.Visible = true;
                    cbTJ_Hour.Visible = true;
                    cbEarlyWarning.Visible = true;
                    radioButton11.Visible = true;//检测项优先级按钮
                }
                if (PublicSet.Myset.DetectMode == "3相机正负单测" || PublicSet.Myset.DetectMode == "4相机正负单测")
                {
                    if (PublicSet.Myset.NegativeSwitch)
                    {
                        radioButton5.Visible = false;
                        radioButton6.Visible = false;
                    }
                    else
                    {
                        radioButton3.Visible = false;
                        radioButton4.Visible = false;
                    }
                }
            }

        }

        Dictionary<string, string> dic_YS1 = new Dictionary<string, string>();
        Dictionary<string, string> dic_XG1 = new Dictionary<string, string>();
        Dictionary<string, bool> dic_YS1Bool = new Dictionary<string, bool>();
        Dictionary<string, bool> dic_XG1Bool = new Dictionary<string, bool>();
        /// <summary>
        /// 获取原始控件string类型参数
        /// </summary>
        /// <param name="con"></param>
        public void GetControl_Text(Control con)
        {
            foreach (Control item in con.Controls)
            {
                if (item is TextBox)
                {
                    dic_YS1[item.Name] = item.Text;
                }
            }
        }
        /// <summary>
        /// 获取原始控件bool类型参数
        /// </summary>
        /// <param name="con"></param>
        public void GetControl_Bool(Control con)
        {
            foreach (Control item in con.Controls)
            {
                if (item is CheckBox)
                {
                    dic_YS1Bool[item.Name] = ((CheckBox)item).Checked;
                }
            }
        }
        /// <summary>
        /// 获取修改后的控件string类型参数
        /// </summary>
        /// <param name="con"></param>
        public void Get_Text(Control con)
        {
            foreach (Control item in con.Controls)
            {
                if (item is TextBox)
                {
                    dic_XG1[item.Name] = item.Text.ToString();
                    if (dic_XG1[item.Name] != dic_YS1[item.Name])
                    {
                        string numberString = "";
                        Match match = Regex.Match(item.Tag.ToString(), @"([^\d]+)(\d+)");
                        if (match.Success)
                        {
                            // 文字
                            numberString = match.Groups[1].Value;
                        }
                        Tool.LogParameterUpdate("用户：" + PublicSet.userInfo.name + " 对 " + numberString + " 进行更改！旧值为：" + dic_YS1[item.Name] + " 当前值为：" + dic_XG1[item.Name]);
                        dic_YS1[item.Name] = dic_XG1[item.Name];
                    }
                }
            }
        }
        /// <summary>
        /// 获取修改后的控件bool类型参数
        /// </summary>
        /// <param name="con"></param>
        public void Get_Bool(Control con)
        {
            foreach (Control item in con.Controls)
            {
                if (item is CheckBox)
                {
                    dic_XG1Bool[item.Name] = ((CheckBox)item).Checked;
                    if (dic_XG1Bool[item.Name] != dic_YS1Bool[item.Name])
                    {
                        string numberString = "";
                        Match match = Regex.Match(item.Tag.ToString(), @"([^\d]+)(\d+)");
                        if (match.Success)
                        {
                            // 文字
                            numberString = match.Groups[1].Value;
                        }
                        else
                        {
                            numberString = item.Tag.ToString();
                        }
                        Tool.LogParameterUpdate("用户：" + PublicSet.userInfo.name + " 对 " + numberString + " 进行状态更改！旧值为：" + dic_YS1Bool[item.Name] + " 当前值为：" + dic_XG1Bool[item.Name]);
                        dic_YS1Bool[item.Name] = dic_XG1Bool[item.Name];
                    }
                }
            }
        }

        private void panelTitle_MouseDown(object sender, MouseEventArgs e)
        {
            Tool.FormMove(Handle);
        }
        int Flag1 = 0, Flag2 = 0, Flag3 = 0, Flag4 = 0, Flag5 = 0, Flag6 = 0, Flag7 = 0;
        private void NavigateBar_Click(object sender, EventArgs e)
        {
            RadioButton rbut = sender as RadioButton;
            switch (rbut.Text)
            {
                case "通讯设置": tabSet.SelectedIndex = 0; break;
                case "相机设置": tabSet.SelectedIndex = 1; CameraSetUI(); break;
                case "负极工艺": tabSet.SelectedIndex = 2; break;
                case "负极V角工艺": tabSet.SelectedIndex = 3; break;
                case "正极工艺": tabSet.SelectedIndex = 4; break;
                case "正极V角工艺": tabSet.SelectedIndex = 5; break;
                case "极耳打折工艺": tabSet.SelectedIndex = 6; break;
                case "缺角工艺": tabSet.SelectedIndex = 7; break;
                case "存储设置": tabSet.SelectedIndex = 8; break;
                case "数据库-配方": tabSet.SelectedIndex = 9; break;
                case "检测项优先级": tabSet.SelectedIndex = 10; break;
                case "极耳打折工艺-壹": tabSet.SelectedIndex = 12; break;
                default: tabSet.SelectedIndex = 11; break;
            }
            //负极工艺
            if (tabSet.SelectedIndex == 2)
            {
                if (PublicSet.userInfo.power == Power.开发者权限)
                {
                    foreach (Control control in tab3.Controls)
                    {
                        control.Visible = true;
                    }
                    foreach (Control control in gbNCompensate.Controls)
                    {
                        control.Visible = true;
                    }
                    Flag2 = 0;
                }
                if (Flag2 < 1)
                {
                    ++Flag2;
                    flag = false;
                    SetControlLocation(tab3, 73, 98, 6, true);
                    flag = false;
                    gbNCompensate.Visible = true;
                    SetControlLocation(gbNCompensate, 73, 16, 1, false);
                    gbNCompensate.Visible = false;
                }
            }
            //负极V工艺
            if (tabSet.SelectedIndex == 3)
            {
                if (PublicSet.userInfo.power == Power.开发者权限)
                {
                    foreach (Control control in tab4.Controls)
                    {
                        control.Visible = true;
                    }
                    foreach (Control control in gbNVCompensate.Controls)
                    {
                        control.Visible = true;
                    }
                    Flag3 = 0;
                }
                if (Flag3 < 1)
                {
                    flag = false;
                    ++Flag3;
                    SetControlLocation(tab4, 73, 68, 6, true);
                    flag = false;
                    gbNVCompensate.Visible = true;
                    SetControlLocation(gbNVCompensate, 73, 12, 1, false);
                    gbNVCompensate.Visible = false;
                }
            }
            //正极工艺
            if (tabSet.SelectedIndex == 4)
            {
                if (PublicSet.userInfo.power == Power.开发者权限)
                {
                    foreach (Control control in tab5.Controls)
                    {
                        control.Visible = true;
                    }
                    foreach (Control control in gbPCompensate.Controls)
                    {
                        control.Visible = true;
                    }
                    Flag4 = 0;
                }
                if (Flag4 < 1)
                {
                    flag = false;
                    ++Flag4;
                    SetControlLocation(tab5, 73, 98, 6, true);
                    flag = false;
                    gbPCompensate.Visible = true;
                    SetControlLocation(gbPCompensate, 73, 16, 1, false);
                    gbPCompensate.Visible = false;
                }
            }
            //正极V工艺
            if (tabSet.SelectedIndex == 5)
            {
                if (PublicSet.userInfo.power == Power.开发者权限)
                {
                    foreach (Control control in tab6.Controls)
                    {
                        control.Visible = true;
                    }
                    foreach (Control control in gbPVCompensate.Controls)
                    {
                        control.Visible = true;
                    }
                    Flag5 = 0;
                }
                if (Flag5 < 1)
                {
                    flag = false;
                    ++Flag5;
                    SetControlLocation(tab6, 73, 68, 6, true);
                    flag = false; gbPVCompensate.Visible = true;
                    SetControlLocation(gbPVCompensate, 73, 12, 1, false);
                    gbPVCompensate.Visible = false;
                }
            }
            //缺角工艺
            if (tabSet.SelectedIndex == 7)
            {
                if (PublicSet.userInfo.power == Power.开发者权限)
                {
                    //负极缺角
                    foreach (Control control in groupBox3.Controls)
                    {
                        control.Visible = true;
                    }
                    //正极缺角
                    foreach (Control control in groupBox1.Controls)
                    {
                        control.Visible = true;
                    }

                    //负极缺角补偿
                    foreach (Control control in gbNBevelCompensate.Controls)
                    {
                        control.Visible = true;
                    }
                    //正极缺角补偿
                    foreach (Control control in gbPBevelCompensate.Controls)
                    {
                        control.Visible = true;
                    }
                    Flag7 = 0;
                }
                if (Flag7 < 1)
                {
                    flag = false;
                    ++Flag7;
                    SetControlLocation(groupBox3, 73, 23, 7, true);
                    flag = false; gbNBevelCompensate.Visible = true; gbPBevelCompensate.Visible = true;
                    SetControlLocation(groupBox1, 73, 23, 7, true);
                    flag = false;
                    SetControlLocation(gbNBevelCompensate, 73, 4, 1, false);
                    flag = false;
                    SetControlLocation(gbPBevelCompensate, 73, 4, 1, false);
                    gbNBevelCompensate.Visible = false; gbPBevelCompensate.Visible = false;
                }
            }
            //检测项优先级
            if (tabSet.SelectedIndex == 10)
            {
                DGVDetectionItemPriority.Rows.Clear();
                for (int i = 0; i < PublicSet.DicDetectionItemPriority.Count; i++)
                {
                    DGVDetectionItemPriority.Rows.Insert(0);
                    DGVDetectionItemPriority["c1", 0].Value = PublicSet.DicDetectionItemPriority.Count - i;
                    DGVDetectionItemPriority["c2", 0].Value = PublicSet.DicDetectionItemPriority[PublicSet.DicDetectionItemPriority.Count - i];
                }
            }

            if (tabSet.SelectedIndex == 11 && PublicSet.userInfo.power == Power.开发者权限)
            {
                cbNullSliceN.Visible = true;
                cbNullSliceP.Visible = true;
            }

        }


        int ip = 0;
        private void labTitle_DoubleClick(object sender, EventArgs e)
        {
            if (ip == 0)
            {
                gbNCompensate.Visible = true;
                gbPCompensate.Visible = true;
                gbNVCompensate.Visible = true;
                gbPVCompensate.Visible = true;
                gbNBevelCompensate.Visible = true;
                gbPBevelCompensate.Visible = true;
                ip = 1;
            }
            else
            {
                gbNCompensate.Visible = false;
                gbPCompensate.Visible = false;
                gbNVCompensate.Visible = false;
                gbPVCompensate.Visible = false;
                gbNBevelCompensate.Visible = false;
                gbPBevelCompensate.Visible = false;
                ip = 0;
            }

        }

        private void bAdd_Click(object sender, EventArgs e)
        {
            new FormUserEdit().ShowDialog();
            QueryUserInfo();
        }

        private void bUpdate_Click(object sender, EventArgs e)
        {
            if (dGVUserInfo.CurrentRow == null)
            {
                return;
            }
            if ((Power)dGVUserInfo.CurrentRow.Cells["CPower"].Value > PublicSet.userInfo.power)
            {
                MessageBox.Show("权限不够");
                return;
            }
            new FormUserEdit(dGVUserInfo.CurrentRow.Cells["CName"].Value.ToString(), (Power)dGVUserInfo.CurrentRow.Cells["CPower"].Value).ShowDialog();
            QueryUserInfo();
        }

        private void bDelete_Click(object sender, EventArgs e)
        {
            if (dGVUserInfo.CurrentRow == null)
            {
                return;
            }
            if ((Power)dGVUserInfo.CurrentRow.Cells["CPower"].Value > PublicSet.userInfo.power)
            {
                MessageBox.Show("权限不够");
                return;
            }
            DeleteUserInfo(dGVUserInfo.CurrentRow.Cells["CName"].Value.ToString());
            QueryUserInfo();
        }

        /// <summary>
        /// 删除用户
        /// </summary>
        /// <param name="name">删除的用户名</param>
        public static void DeleteUserInfo(string name)
        {
            MySQLHelper.ExecuteNonQuery(PublicSet.Connection, $"DELETE FROM tb_user WHERE name = '{name}';");
        }




        string[] Str;

        public void Read(string[] str)
        {
            Str = str;
        }
        public void MouseDown_Right(object sender, MouseEventArgs e)
        {
            if (PublicSet.userInfo.power < Power.超级管理员) return;
            if (e.Button == MouseButtons.Right)
            {
                FormCheck fc;
                Match match = Regex.Match((sender as CheckBox).Tag.ToString(), @"([^\d]+)(\d+)");
                if (match.Success)
                {
                    // 数值
                    string numberString = match.Groups[1].Value;
                    switch (numberString)
                    {
                        case "负极片头宽开关":
                            fc = new FormCheck(PublicSet.Myset.NJPHeadWidthType, PublicSet.Myset.NJPWidthTogetherCount, PublicSet.Myset.NJPWidthTogetherJudge, PublicSet.Myset.NJPHeadWidth_LL, PublicSet.Myset.NJPHeadWidthCancelJudgment, PublicSet.Myset.NJPHeadWidthChart, false, "极片头宽");
                            fc.ReadStrEvent += Read; fc.ShowDialog();
                            PublicSet.Myset.NJPHeadWidthType = Str[0];
                            PublicSet.Myset.NJPWidthTogetherCount = bool.Parse(Str[1]);
                            PublicSet.Myset.NJPWidthTogetherJudge = bool.Parse(Str[2]);
                            PublicSet.Myset.NJPHeadWidth_LL = bool.Parse(Str[3]);
                            PublicSet.Myset.NJPHeadWidthCancelJudgment = bool.Parse(Str[4]);
                            PublicSet.Myset.NJPHeadWidthChart = bool.Parse(Str[5]); break;
                        case "负极片尾宽开关":
                            fc = new FormCheck(PublicSet.Myset.NJPTailWidthType, PublicSet.Myset.NJPWidthTogetherCount, PublicSet.Myset.NJPWidthTogetherJudge, PublicSet.Myset.NJPTailWidth_LL, PublicSet.Myset.NJPTailWidthCancelJudgment, PublicSet.Myset.NJPTailWidthChart, false, "极片尾宽");
                            fc.ReadStrEvent += Read;
                            fc.ShowDialog(); PublicSet.Myset.NJPTailWidthType = Str[0];
                            PublicSet.Myset.NJPWidthTogetherCount = bool.Parse(Str[1]);
                            PublicSet.Myset.NJPWidthTogetherJudge = bool.Parse(Str[2]);
                            PublicSet.Myset.NJPTailWidth_LL = bool.Parse(Str[3]);
                            PublicSet.Myset.NJPTailWidthCancelJudgment = bool.Parse(Str[4]);
                            PublicSet.Myset.NJPTailWidthChart = bool.Parse(Str[5]); break;
                        case "负极片头长开关":
                            fc = new FormCheck(PublicSet.Myset.NJPHeadLengthType, false, PublicSet.Myset.NJPLengthTogetherJudge, PublicSet.Myset.NJPHeadLength_LL, PublicSet.Myset.NJPHeadLengthCancelJudgment, false, false, "极片头长");
                            fc.ReadStrEvent += Read; fc.ShowDialog();
                            PublicSet.Myset.NJPHeadLengthType = Str[0];
                            PublicSet.Myset.NJPLengthTogetherJudge = bool.Parse(Str[2]);
                            PublicSet.Myset.NJPHeadLength_LL = bool.Parse(Str[3]);
                            PublicSet.Myset.NJPHeadLengthCancelJudgment = bool.Parse(Str[4]); break;
                        case "负极片尾长开关":
                            fc = new FormCheck(PublicSet.Myset.NJPTailLengthType, false, PublicSet.Myset.NJPLengthTogetherJudge, PublicSet.Myset.NJPTailLength_LL, PublicSet.Myset.NJPTailLengthCancelJudgment, false, false, "极片尾长");
                            fc.ReadStrEvent += Read; fc.ShowDialog();
                            PublicSet.Myset.NJPTailLengthType = Str[0];
                            PublicSet.Myset.NJPLengthTogetherJudge = bool.Parse(Str[2]);
                            PublicSet.Myset.NJPTailLength_LL = bool.Parse(Str[3]);
                            PublicSet.Myset.NJPTailLengthCancelJudgment = bool.Parse(Str[4]); break;
                        case "负极总宽开关":
                            fc = new FormCheck(PublicSet.Myset.NJPTotalWidthType, false, false, PublicSet.Myset.NJPTotalWidth_LL, PublicSet.Myset.NJPTotalWidthCancelJudgment, false, false, "总宽");
                            fc.ReadStrEvent += Read; fc.ShowDialog();
                            PublicSet.Myset.NJPTotalWidthType = Str[0];
                            PublicSet.Myset.NJPTotalWidth_LL = bool.Parse(Str[3]);
                            PublicSet.Myset.NJPTotalWidthCancelJudgment = bool.Parse(Str[4]); break;
                        case "负极涂布高开关":
                            fc = new FormCheck(PublicSet.Myset.NJPCoatingType, false, false, PublicSet.Myset.NJPCoating_LL, PublicSet.Myset.NJPCoatingCancelJudgment, false, false, "涂布高");
                            fc.ReadStrEvent += Read; fc.ShowDialog();
                            PublicSet.Myset.NJPCoatingType = Str[0];
                            PublicSet.Myset.NJPCoating_LL = bool.Parse(Str[3]);
                            PublicSet.Myset.NJPCoatingCancelJudgment = bool.Parse(Str[4]); break;
                        case "负极左肩宽开关":
                            fc = new FormCheck(PublicSet.Myset.NJELeftShoulderType, PublicSet.Myset.NJEShoulderTogetherCount, PublicSet.Myset.NJEShoulderTogetherJudge, PublicSet.Myset.NJELeftShoulder_LL, PublicSet.Myset.NJELeftShoulderCancelJudgment, PublicSet.Myset.NJELeftShoulderChart, PublicSet.Myset.NJELeftShoulderArc, "左肩宽");
                            fc.ReadStrEvent += Read; fc.ShowDialog();
                            PublicSet.Myset.NJELeftShoulderType = Str[0];
                            PublicSet.Myset.NJEShoulderTogetherCount = bool.Parse(Str[1]);
                            PublicSet.Myset.NJEShoulderTogetherJudge = bool.Parse(Str[2]);
                            PublicSet.Myset.NJELeftShoulder_LL = bool.Parse(Str[3]);
                            PublicSet.Myset.NJELeftShoulderCancelJudgment = bool.Parse(Str[4]);
                            PublicSet.Myset.NJELeftShoulderChart = bool.Parse(Str[5]);
                            PublicSet.Myset.NJELeftShoulderArc = bool.Parse(Str[6]); break;
                        case "负极右肩宽开关":
                            fc = new FormCheck(PublicSet.Myset.NJERightShoulderType, PublicSet.Myset.NJEShoulderTogetherCount, PublicSet.Myset.NJEShoulderTogetherJudge, PublicSet.Myset.NJERightShoulder_LL, PublicSet.Myset.NJERightShoulderCancelJudgment, PublicSet.Myset.NJERightShoulderChart, PublicSet.Myset.NJERightShoulderArc, "右肩宽");
                            fc.ReadStrEvent += Read; fc.ShowDialog();
                            PublicSet.Myset.NJERightShoulderType = Str[0];
                            PublicSet.Myset.NJEShoulderTogetherCount = bool.Parse(Str[1]);
                            PublicSet.Myset.NJEShoulderTogetherJudge = bool.Parse(Str[2]);
                            PublicSet.Myset.NJERightShoulder_LL = bool.Parse(Str[3]);
                            PublicSet.Myset.NJERightShoulderCancelJudgment = bool.Parse(Str[4]);
                            PublicSet.Myset.NJERightShoulderChart = bool.Parse(Str[5]);
                            PublicSet.Myset.NJERightShoulderArc = bool.Parse(Str[6]); break;

                        case "负极极耳宽开关":
                            fc = new FormCheck(PublicSet.Myset.NJEWidthType, false, false, PublicSet.Myset.NJEWidth_LL, PublicSet.Myset.NJEWidthCancelJudgment, false, false, "极耳宽");
                            fc.ReadStrEvent += Read; fc.ShowDialog();
                            PublicSet.Myset.NJEWidthType = Str[0];
                            PublicSet.Myset.NJEWidth_LL = bool.Parse(Str[3]);
                            PublicSet.Myset.NJEWidthCancelJudgment = bool.Parse(Str[4]); break;

                        case "负极极耳高开关":
                            fc = new FormCheck("", false, false, PublicSet.Myset.NJEHeight_LL, PublicSet.Myset.NJEHeightCancelJudgment, false, false, "极耳高");
                            fc.ReadStrEvent += Read; fc.ShowDialog();
                            PublicSet.Myset.NJEHeight_LL = bool.Parse(Str[3]);
                            PublicSet.Myset.NJEHeightCancelJudgment = bool.Parse(Str[4]); break;
                        case "负极带料高开关":
                            fc = new FormCheck("", false, false, PublicSet.Myset.NJEHeight_LL, PublicSet.Myset.NDLHeightCancelJudgment, false, false, "带料高");
                            fc.ReadStrEvent += Read; fc.ShowDialog();
                            PublicSet.Myset.NDLHeight_LL = bool.Parse(Str[3]);
                            PublicSet.Myset.NDLHeightCancelJudgment = bool.Parse(Str[4]); break;

                        case "负极对角线开关":
                            fc = new FormCheck("", false, false, false, PublicSet.Myset.NDiagonalCancelJudgment, false, false, "对角线");
                            fc.ReadStrEvent += Read; fc.ShowDialog();
                            PublicSet.Myset.NDiagonalCancelJudgment = bool.Parse(Str[4]); break;

                        case "负极左上角度开关":
                            fc = new FormCheck("", false, false, false, PublicSet.Myset.NLeftUpAngleCancelJudgment, false, false, "左上相机角度");
                            fc.ReadStrEvent += Read; fc.ShowDialog();
                            PublicSet.Myset.NLeftUpAngleCancelJudgment = bool.Parse(Str[4]); break;
                        case "负极右上角度开关":
                            fc = new FormCheck("", false, false, false, PublicSet.Myset.NRightUpAngleCancelJudgment, false, false, "右上相机角度");
                            fc.ReadStrEvent += Read; fc.ShowDialog();
                            PublicSet.Myset.NRightUpAngleCancelJudgment = bool.Parse(Str[4]); break;
                        case "负极左下角度开关":
                            fc = new FormCheck("", false, false, false, PublicSet.Myset.NLeftDownAngleCancelJudgment, false, false, "左下相机角度");
                            fc.ReadStrEvent += Read; fc.ShowDialog();
                            PublicSet.Myset.NLeftDownAngleCancelJudgment = bool.Parse(Str[4]); break;
                        case "负极右下角度开关":
                            fc = new FormCheck("", false, false, false, PublicSet.Myset.NRightDownAngleCancelJudgment, false, false, "右下相机角度");
                            fc.ReadStrEvent += Read; fc.ShowDialog();
                            PublicSet.Myset.NRightDownAngleCancelJudgment = bool.Parse(Str[4]); break;


                        case "负极左上V角度开关":
                            fc = new FormCheck("", false, false, false, PublicSet.Myset.NLeftUpVAngleCancelJudgment, false, false, "左上V角度");
                            fc.ReadStrEvent += Read; fc.ShowDialog();
                            PublicSet.Myset.NLeftUpVAngleCancelJudgment = bool.Parse(Str[4]); break;
                        case "负极右上V角度开关":
                            fc = new FormCheck("", false, false, false, PublicSet.Myset.NRightDownVAngleCancelJudgment, false, false, "右上V角度");
                            fc.ReadStrEvent += Read; fc.ShowDialog();
                            PublicSet.Myset.NRightDownVAngleCancelJudgment = bool.Parse(Str[4]); break;
                        case "负极左下V角度开关":
                            fc = new FormCheck("", false, false, false, PublicSet.Myset.NLeftDownVAngleCancelJudgment, false, false, "左下V角度");
                            fc.ReadStrEvent += Read; fc.ShowDialog();
                            PublicSet.Myset.NLeftDownVAngleCancelJudgment = bool.Parse(Str[4]); break;
                        case "负极右下V角度开关":
                            fc = new FormCheck("", false, false, false, PublicSet.Myset.NRightDownVAngleCancelJudgment, false, false, "右下V角度");
                            fc.ReadStrEvent += Read; fc.ShowDialog();
                            PublicSet.Myset.NRightDownVAngleCancelJudgment = bool.Parse(Str[4]); break;

                        case "负极左上V深度开关":
                            fc = new FormCheck("", false, PublicSet.Myset.NLURUVDepthTogetherJudge, false, PublicSet.Myset.NLeftUpVDepthCancelJudgment, false, false, "左上V深度");
                            fc.ReadStrEvent += Read; fc.ShowDialog();
                            PublicSet.Myset.NLURUVDepthTogetherJudge = bool.Parse(Str[2]);
                            PublicSet.Myset.NLeftUpVDepthCancelJudgment = bool.Parse(Str[4]); break;
                        case "负极右上V深度开关":
                            fc = new FormCheck("", false, PublicSet.Myset.NLURUVDepthTogetherJudge, false, PublicSet.Myset.NRightUpVDepthCancelJudgment, false, false, "右上V深度");
                            fc.ReadStrEvent += Read; fc.ShowDialog();
                            PublicSet.Myset.NLURUVDepthTogetherJudge = bool.Parse(Str[2]);
                            PublicSet.Myset.NRightUpVDepthCancelJudgment = bool.Parse(Str[4]); break;
                        case "负极左下V深度开关":
                            fc = new FormCheck("", false, PublicSet.Myset.NLDRDVDepthTogetherJudge, false, PublicSet.Myset.NLeftDownVDepthCancelJudgment, false, false, "左下V深度");
                            fc.ReadStrEvent += Read; fc.ShowDialog();
                            PublicSet.Myset.NLDRDVDepthTogetherJudge = bool.Parse(Str[2]);
                            PublicSet.Myset.NLeftDownVDepthCancelJudgment = bool.Parse(Str[4]); break;
                        case "负极右下V深度开关":
                            fc = new FormCheck("", false, PublicSet.Myset.NLDRDVDepthTogetherJudge, false, PublicSet.Myset.NRightDownVDepthCancelJudgment, false, false, "右下V深度");
                            fc.ReadStrEvent += Read; fc.ShowDialog();
                            PublicSet.Myset.NLDRDVDepthTogetherJudge = bool.Parse(Str[2]);
                            PublicSet.Myset.NRightDownVDepthCancelJudgment = bool.Parse(Str[4]); break;

                        case "负极左上V宽度开关":
                            fc = new FormCheck(PublicSet.Myset.NLeftUpVWidthType, false, false, false, PublicSet.Myset.NLeftUpVWidthCancelJudgment, false, false, "左上V宽度");
                            fc.ReadStrEvent += Read; fc.ShowDialog();
                            PublicSet.Myset.NLeftUpVWidthType = Str[0];
                            PublicSet.Myset.NLeftUpVWidthCancelJudgment = bool.Parse(Str[4]); break;
                        case "负极右上V宽度开关":
                            fc = new FormCheck(PublicSet.Myset.NRightUpVWidthType, false, false, false, PublicSet.Myset.NRightUpVWidthCancelJudgment, false, false, "右上V宽度");
                            fc.ReadStrEvent += Read; fc.ShowDialog();
                            PublicSet.Myset.NRightUpVWidthType = Str[0];
                            PublicSet.Myset.NRightUpVWidthCancelJudgment = bool.Parse(Str[4]); break;
                        case "负极左下V宽度开关":
                            fc = new FormCheck(PublicSet.Myset.NLeftDownVWidthType, false, false, false, PublicSet.Myset.NLeftDownVWidthCancelJudgment, false, false, "左下V宽度");
                            fc.ReadStrEvent += Read; fc.ShowDialog();
                            PublicSet.Myset.NLeftDownVWidthType = Str[0];
                            PublicSet.Myset.NLeftDownVWidthCancelJudgment = bool.Parse(Str[4]); break;
                        case "负极右下V宽度开关":
                            fc = new FormCheck(PublicSet.Myset.NRightDownVWidthType, false, false, false, PublicSet.Myset.NRightDownVWidthCancelJudgment, false, false, "右下V宽度");
                            fc.ReadStrEvent += Read; fc.ShowDialog();
                            PublicSet.Myset.NRightDownVWidthType = Str[0];
                            PublicSet.Myset.NRightDownVWidthCancelJudgment = bool.Parse(Str[4]); break;



                        case "正极片头宽开关":
                            fc = new FormCheck(PublicSet.Myset.PJPHeadWidthType, PublicSet.Myset.PJPWidthTogetherCount, PublicSet.Myset.PJPWidthTogetherJudge, PublicSet.Myset.PJPHeadWidth_LL, PublicSet.Myset.PJPHeadWidthCancelJudgment, PublicSet.Myset.PJPHeadWidthChart, false, "极片头宽");
                            fc.ReadStrEvent += Read; fc.ShowDialog();
                            PublicSet.Myset.PJPHeadWidthType = Str[0];
                            PublicSet.Myset.PJPWidthTogetherCount = bool.Parse(Str[1]);
                            PublicSet.Myset.PJPWidthTogetherJudge = bool.Parse(Str[2]);
                            PublicSet.Myset.PJPHeadWidth_LL = bool.Parse(Str[3]);
                            PublicSet.Myset.PJPHeadWidthCancelJudgment = bool.Parse(Str[4]);
                            PublicSet.Myset.PJPHeadWidthChart = bool.Parse(Str[5]); break;
                        case "正极片尾宽开关":
                            fc = new FormCheck(PublicSet.Myset.PJPTailWidthType, PublicSet.Myset.PJPWidthTogetherCount, PublicSet.Myset.PJPWidthTogetherJudge, PublicSet.Myset.PJPTailWidth_LL, PublicSet.Myset.PJPTailWidthCancelJudgment, PublicSet.Myset.PJPTailWidthChart, false, "极片尾宽");
                            fc.ReadStrEvent += Read; fc.ShowDialog();
                            PublicSet.Myset.PJPTailWidthType = Str[0];
                            PublicSet.Myset.PJPWidthTogetherCount = bool.Parse(Str[1]);
                            PublicSet.Myset.PJPWidthTogetherJudge = bool.Parse(Str[2]);
                            PublicSet.Myset.PJPTailWidth_LL = bool.Parse(Str[3]);
                            PublicSet.Myset.PJPTailWidthCancelJudgment = bool.Parse(Str[4]);
                            PublicSet.Myset.PJPTailWidthChart = bool.Parse(Str[5]); break;
                        case "正极片头长开关":
                            fc = new FormCheck(PublicSet.Myset.PJPHeadLengthType, false, PublicSet.Myset.PJPLengthTogetherJudge, PublicSet.Myset.PJPHeadLength_LL, PublicSet.Myset.PJPHeadLengthCancelJudgment, false, false, "极片头长");
                            fc.ReadStrEvent += Read; fc.ShowDialog();
                            PublicSet.Myset.PJPHeadLengthType = Str[0];
                            PublicSet.Myset.PJPLengthTogetherJudge = bool.Parse(Str[2]);
                            PublicSet.Myset.PJPHeadLength_LL = bool.Parse(Str[3]);
                            PublicSet.Myset.PJPHeadLengthCancelJudgment = bool.Parse(Str[4]); break;
                        case "正极片尾长开关":
                            fc = new FormCheck(PublicSet.Myset.PJPTailLengthType, false, PublicSet.Myset.PJPLengthTogetherJudge, PublicSet.Myset.PJPTailLength_LL, PublicSet.Myset.PJPTailLengthCancelJudgment, false, false, "极片尾长");
                            fc.ReadStrEvent += Read; fc.ShowDialog();
                            PublicSet.Myset.PJPTailLengthType = Str[0];
                            PublicSet.Myset.PJPLengthTogetherJudge = bool.Parse(Str[2]);
                            PublicSet.Myset.PJPTailLength_LL = bool.Parse(Str[3]);
                            PublicSet.Myset.PJPTailLengthCancelJudgment = bool.Parse(Str[4]); break;
                        case "正极总宽开关":
                            fc = new FormCheck(PublicSet.Myset.PJPTotalWidthType, false, false, PublicSet.Myset.PJPTotalWidth_LL, PublicSet.Myset.PJPTotalWidthCancelJudgment, false, false, "总宽");
                            fc.ReadStrEvent += Read; fc.ShowDialog();
                            PublicSet.Myset.PJPTotalWidthType = Str[0];
                            PublicSet.Myset.PJPTotalWidth_LL = bool.Parse(Str[3]);
                            PublicSet.Myset.PJPTotalWidthCancelJudgment = bool.Parse(Str[4]); break;
                        case "正极涂布高开关":
                            fc = new FormCheck(PublicSet.Myset.PJPCoatingType, false, false, PublicSet.Myset.PJPCoating_LL, PublicSet.Myset.PJPCoatingCancelJudgment, false, false, "涂布高");
                            fc.ReadStrEvent += Read; fc.ShowDialog();
                            PublicSet.Myset.PJPCoatingType = Str[0];
                            PublicSet.Myset.PJPCoating_LL = bool.Parse(Str[3]);
                            PublicSet.Myset.PJPCoatingCancelJudgment = bool.Parse(Str[4]); break;
                        case "正极左肩宽开关":
                            fc = new FormCheck(PublicSet.Myset.PJELeftShoulderType, PublicSet.Myset.PJEShoulderTogetherCount, PublicSet.Myset.PJEShoulderTogetherJudge, PublicSet.Myset.PJELeftShoulder_LL, PublicSet.Myset.PJELeftShoulderCancelJudgment, PublicSet.Myset.PJELeftShoulderChart, PublicSet.Myset.PJELeftShoulderArc, "左肩宽");
                            fc.ReadStrEvent += Read; fc.ShowDialog();
                            PublicSet.Myset.PJELeftShoulderType = Str[0];
                            PublicSet.Myset.PJEShoulderTogetherCount = bool.Parse(Str[1]);
                            PublicSet.Myset.PJEShoulderTogetherJudge = bool.Parse(Str[2]);
                            PublicSet.Myset.PJELeftShoulder_LL = bool.Parse(Str[3]);
                            PublicSet.Myset.PJELeftShoulderCancelJudgment = bool.Parse(Str[4]);
                            PublicSet.Myset.PJELeftShoulderChart = bool.Parse(Str[5]);
                            PublicSet.Myset.PJELeftShoulderArc = bool.Parse(Str[6]); break;


                        case "正极右肩宽开关":
                            fc = new FormCheck(PublicSet.Myset.PJERightShoulderType, PublicSet.Myset.PJEShoulderTogetherCount, PublicSet.Myset.PJEShoulderTogetherJudge, PublicSet.Myset.PJERightShoulder_LL, PublicSet.Myset.PJERightShoulderCancelJudgment, PublicSet.Myset.PJERightShoulderChart, PublicSet.Myset.PJERightShoulderArc, "右肩宽");
                            fc.ReadStrEvent += Read; fc.ShowDialog();
                            PublicSet.Myset.PJERightShoulderType = Str[0];
                            PublicSet.Myset.PJEShoulderTogetherCount = bool.Parse(Str[1]);
                            PublicSet.Myset.PJEShoulderTogetherJudge = bool.Parse(Str[2]);
                            PublicSet.Myset.PJERightShoulder_LL = bool.Parse(Str[3]);
                            PublicSet.Myset.PJERightShoulderCancelJudgment = bool.Parse(Str[4]);
                            PublicSet.Myset.PJERightShoulderChart = bool.Parse(Str[5]);
                            PublicSet.Myset.PJERightShoulderArc = bool.Parse(Str[6]); break;

                        case "正极极耳宽开关":
                            fc = new FormCheck(PublicSet.Myset.PJEWidthType, false, false, PublicSet.Myset.PJEWidth_LL, PublicSet.Myset.PJEWidthCancelJudgment, false, false, "极耳宽"); fc.ReadStrEvent += Read; fc.ShowDialog();
                            PublicSet.Myset.PJEWidthType = Str[0];
                            PublicSet.Myset.PJEWidth_LL = bool.Parse(Str[3]);
                            PublicSet.Myset.PJEWidthCancelJudgment = bool.Parse(Str[4]); break;

                        case "正极极耳高开关":
                            fc = new FormCheck("", false, false, PublicSet.Myset.PJEHeight_LL, PublicSet.Myset.PJEHeightCancelJudgment, false, false, "极耳高");
                            fc.ReadStrEvent += Read; fc.ShowDialog();
                            PublicSet.Myset.PJEHeight_LL = bool.Parse(Str[3]);
                            PublicSet.Myset.PJEHeightCancelJudgment = bool.Parse(Str[4]); break;
                        case "正极陶瓷高开关":
                            fc = new FormCheck("", false, false, PublicSet.Myset.PJEHeight_LL, PublicSet.Myset.PCeramicHeightCancelJudgment, false, false, "陶瓷高");
                            fc.ReadStrEvent += Read; fc.ShowDialog();
                            PublicSet.Myset.PCeramicHeight_LL = bool.Parse(Str[3]); break;
                            PublicSet.Myset.PCeramicHeightCancelJudgment = bool.Parse(Str[4]); break;

                        case "正极对角线开关":
                            fc = new FormCheck("", false, false, false, PublicSet.Myset.PDiagonalCancelJudgment, false, false, "对角线");
                            fc.ReadStrEvent += Read; fc.ShowDialog();
                            PublicSet.Myset.PDiagonalCancelJudgment = bool.Parse(Str[4]); break;

                        case "正极左上角度开关":
                            fc = new FormCheck("", false, false, false, PublicSet.Myset.PLeftUpAngleCancelJudgment, false, false, "左上相机角度");
                            fc.ReadStrEvent += Read; fc.ShowDialog();
                            PublicSet.Myset.PLeftUpAngleCancelJudgment = bool.Parse(Str[4]); break;
                        case "正极右上角度开关":
                            fc = new FormCheck("", false, false, false, PublicSet.Myset.PRightUpAngleCancelJudgment, false, false, "右上相机角度");
                            fc.ReadStrEvent += Read; fc.ShowDialog();
                            PublicSet.Myset.PRightUpAngleCancelJudgment = bool.Parse(Str[4]); break;
                        case "正极左下角度开关":
                            fc = new FormCheck("", false, false, false, PublicSet.Myset.PLeftDownAngleCancelJudgment, false, false, "左下相机角度");
                            fc.ReadStrEvent += Read; fc.ShowDialog();
                            PublicSet.Myset.PLeftDownAngleCancelJudgment = bool.Parse(Str[4]); break;
                        case "正极右下角度开关":
                            fc = new FormCheck("", false, false, false, PublicSet.Myset.PRightDownAngleCancelJudgment, false, false, "右下相机角度");
                            fc.ReadStrEvent += Read; fc.ShowDialog();
                            PublicSet.Myset.PRightDownAngleCancelJudgment = bool.Parse(Str[4]); break;


                        case "正极左上V角度开关":
                            fc = new FormCheck("", false, false, false, PublicSet.Myset.PLeftUpVAngleCancelJudgment, false, false, "左上V角度");
                            fc.ReadStrEvent += Read; fc.ShowDialog();
                            PublicSet.Myset.PLeftUpVAngleCancelJudgment = bool.Parse(Str[4]); break;
                        case "正极右上V角度开关":
                            fc = new FormCheck("", false, false, false, PublicSet.Myset.PRightUpVAngleCancelJudgment, false, false, "右上V角度");
                            fc.ReadStrEvent += Read; fc.ShowDialog();
                            PublicSet.Myset.PRightUpVAngleCancelJudgment = bool.Parse(Str[4]); break;
                        case "正极左下V角度开关":
                            fc = new FormCheck("", false, false, false, PublicSet.Myset.PLeftDownVAngleCancelJudgment, false, false, "左下V角度");
                            fc.ReadStrEvent += Read; fc.ShowDialog();
                            PublicSet.Myset.PLeftDownVAngleCancelJudgment = bool.Parse(Str[4]); break;
                        case "正极右下V角度开关":
                            fc = new FormCheck("", false, false, false, PublicSet.Myset.PRightDownVAngleCancelJudgment, false, false, "右下V角度");
                            fc.ReadStrEvent += Read; fc.ShowDialog();
                            PublicSet.Myset.PRightDownVAngleCancelJudgment = bool.Parse(Str[4]); break;

                        case "正极左上V深度开关":
                            fc = new FormCheck("", false, PublicSet.Myset.PLURUVDepthTogetherJudge, false, PublicSet.Myset.PLeftUpVDepthCancelJudgment, false, false, "左上V深度");
                            fc.ReadStrEvent += Read; fc.ShowDialog();
                            PublicSet.Myset.PLURUVDepthTogetherJudge = bool.Parse(Str[2]);
                            PublicSet.Myset.PLeftUpVDepthCancelJudgment = bool.Parse(Str[4]); break;
                        case "正极右上V深度开关":
                            fc = new FormCheck("", false, PublicSet.Myset.PLURUVDepthTogetherJudge, false, PublicSet.Myset.PRightUpVDepthCancelJudgment, false, false, "右上V深度");
                            fc.ReadStrEvent += Read; fc.ShowDialog();
                            PublicSet.Myset.PLURUVDepthTogetherJudge = bool.Parse(Str[2]);
                            PublicSet.Myset.PRightUpVDepthCancelJudgment = bool.Parse(Str[4]); break;

                        case "正极左下V深度开关":
                            fc = new FormCheck("", false, PublicSet.Myset.PLDRDVDepthTogetherJudge, false, PublicSet.Myset.PLeftDownVDepthCancelJudgment, false, false, "左下V深度");
                            fc.ReadStrEvent += Read; fc.ShowDialog();
                            PublicSet.Myset.PLDRDVDepthTogetherJudge = bool.Parse(Str[2]);
                            PublicSet.Myset.PLeftDownVDepthCancelJudgment = bool.Parse(Str[4]); break;
                        case "正极右下V深度开关":
                            fc = new FormCheck("", false, PublicSet.Myset.PLDRDVDepthTogetherJudge, false, PublicSet.Myset.PRightDownVDepthCancelJudgment, false, false, "右下V深度");
                            fc.ReadStrEvent += Read; fc.ShowDialog();
                            PublicSet.Myset.PLDRDVDepthTogetherJudge = bool.Parse(Str[2]);
                            PublicSet.Myset.PRightDownVDepthCancelJudgment = bool.Parse(Str[4]); break;

                        case "正极左上V宽度开关":
                            fc = new FormCheck(PublicSet.Myset.PLeftUpVWidthType, false, false, false, PublicSet.Myset.PLeftUpVWidthCancelJudgment, false, false, "左上V宽度");
                            fc.ReadStrEvent += Read; fc.ShowDialog();
                            PublicSet.Myset.PLeftUpVWidthType = Str[0];
                            PublicSet.Myset.PLeftUpVWidthCancelJudgment = bool.Parse(Str[4]); break;
                        case "正极右上V宽度开关":
                            fc = new FormCheck(PublicSet.Myset.PRightUpVWidthType, false, false, false, PublicSet.Myset.PRightUpVWidthCancelJudgment, false, false, "右上V宽度");
                            fc.ReadStrEvent += Read; fc.ShowDialog();
                            PublicSet.Myset.PRightUpVWidthType = Str[0];
                            PublicSet.Myset.PRightUpVWidthCancelJudgment = bool.Parse(Str[4]); break;
                        case "正极左下V宽度开关":
                            fc = new FormCheck(PublicSet.Myset.PLeftDownVWidthType, false, false, false, PublicSet.Myset.PLeftDownVWidthCancelJudgment, false, false, "左下V宽度");
                            fc.ReadStrEvent += Read; fc.ShowDialog();
                            PublicSet.Myset.PLeftDownVWidthType = Str[0];
                            PublicSet.Myset.PLeftDownVWidthCancelJudgment = bool.Parse(Str[4]); break;
                        case "正极右下V宽度开关":
                            fc = new FormCheck(PublicSet.Myset.PRightDownVWidthType, false, false, false, PublicSet.Myset.PRightDownVWidthCancelJudgment, false, false, "右下V宽度");
                            fc.ReadStrEvent += Read; fc.ShowDialog();
                            PublicSet.Myset.PRightDownVWidthType = Str[0];
                            PublicSet.Myset.PRightDownVWidthCancelJudgment = bool.Parse(Str[4]); break;
                        default:
                            break;
                    }
                }
            }
        }

        //------------------------------------------------------------------------------------------------
        private void cbNJPHeadWidthSwitch_CheckedChanged(object sender, EventArgs e)
        {
            tbNJPHeadWidthMin.Enabled = cbNJPHeadWidthSwitch.Checked;
            tbNJPHeadWidthMax.Enabled = cbNJPHeadWidthSwitch.Checked;
            tbNJPHeadWidthStandard.Enabled = cbNJPHeadWidthSwitch.Checked;
            tbNJPHeadWidthName.Enabled = cbNJPHeadWidthSwitch.Checked;
        }

        private void cbNJPTailWidthSwitch_CheckedChanged(object sender, EventArgs e)
        {
            tbNJPTailWidthMin.Enabled = cbNJPTailWidthSwitch.Checked;
            tbNJPTailWidthMax.Enabled = cbNJPTailWidthSwitch.Checked;
            tbNJPTailWidthStandard.Enabled = cbNJPTailWidthSwitch.Checked;
            tbNJPTailWidthName.Enabled = cbNJPTailWidthSwitch.Checked;
        }

        private void cbNJPHeadLengthSwitch_CheckedChanged(object sender, EventArgs e)
        {
            tbNJPHeadLengthMin.Enabled = cbNJPHeadLengthSwitch.Checked;
            tbNJPHeadLengthMax.Enabled = cbNJPHeadLengthSwitch.Checked;
            tbNJPHeadLengthStandard.Enabled = cbNJPHeadLengthSwitch.Checked;
            tbNJPHeadLengthName.Enabled = cbNJPHeadLengthSwitch.Checked;
        }

        private void cbNJPTailLengthSwitch_CheckedChanged(object sender, EventArgs e)
        {
            tbNJPTailLengthMin.Enabled = cbNJPTailLengthSwitch.Checked;
            tbNJPTailLengthMax.Enabled = cbNJPTailLengthSwitch.Checked;
            tbNJPTailLengthStandard.Enabled = cbNJPTailLengthSwitch.Checked;
            tbNJPTailLengthName.Enabled = cbNJPTailLengthSwitch.Checked;
        }

        private void cbNJELeftShoulderSwitch_CheckedChanged(object sender, EventArgs e)
        {
            tbNJELeftShoulderMin.Enabled = cbNJELeftShoulderSwitch.Checked;
            tbNJELeftShoulderMax.Enabled = cbNJELeftShoulderSwitch.Checked;
            tbNJELeftShoulderStandard.Enabled = cbNJELeftShoulderSwitch.Checked;
            tbNJELeftShoulderName.Enabled = cbNJELeftShoulderSwitch.Checked;
        }

        private void cbNJERightShoulderSwitch_CheckedChanged(object sender, EventArgs e)
        {
            tbNJERightShoulderMin.Enabled = cbNJERightShoulderSwitch.Checked;
            tbNJERightShoulderMax.Enabled = cbNJERightShoulderSwitch.Checked;
            tbNJERightShoulderStandard.Enabled = cbNJERightShoulderSwitch.Checked;
            tbNJERightShoulderName.Enabled = cbNJERightShoulderSwitch.Checked;
        }

        private void cbNJEWidthSwitch_CheckedChanged(object sender, EventArgs e)
        {
            tbNJEWidthMin.Enabled = cbNJEWidthSwitch.Checked;
            tbNJEWidthMax.Enabled = cbNJEWidthSwitch.Checked;
            tbNJEWidthStandard.Enabled = cbNJEWidthSwitch.Checked;
            tbNJEWidthName.Enabled = cbNJEWidthSwitch.Checked;
        }

        private void cbNJEHeightSwitch_CheckedChanged(object sender, EventArgs e)
        {
            tbNJEHeightMin.Enabled = cbNJEHeightSwitch.Checked;
            tbNJEHeightMax.Enabled = cbNJEHeightSwitch.Checked;
            tbNJEHeightStandard.Enabled = cbNJEHeightSwitch.Checked;
            tbNJEHeightName.Enabled = cbNJEHeightSwitch.Checked;
        }

        private void cbNDLHeightSwitch_CheckedChanged(object sender, EventArgs e)
        {
            tbNDLHeightMin.Enabled = cbNDLHeightSwitch.Checked;
            tbNDLHeightMax.Enabled = cbNDLHeightSwitch.Checked;
            tbNDLHeightStandard.Enabled = cbNDLHeightSwitch.Checked;
            tbNDLHeightName.Enabled = cbNDLHeightSwitch.Checked;
        }

        private void cbNJPTotalWidthSwitch_CheckedChanged(object sender, EventArgs e)
        {
            tbNJPTotalWidthMin.Enabled = cbNJPTotalWidthSwitch.Checked;
            tbNJPTotalWidthMax.Enabled = cbNJPTotalWidthSwitch.Checked;
            tbNJPTotalWidthStandard.Enabled = cbNJPTotalWidthSwitch.Checked;
            tbNJPTotalWidthName.Enabled = cbNJPTotalWidthSwitch.Checked;
        }

        private void cbNJPCoatingSwitch_CheckedChanged(object sender, EventArgs e)
        {
            tbNJPCoatingMin.Enabled = cbNJPCoatingSwitch.Checked;
            tbNJPCoatingMax.Enabled = cbNJPCoatingSwitch.Checked;
            tbNJPCoatingStandard.Enabled = cbNJPCoatingSwitch.Checked;
            tbNJPCoatingName.Enabled = cbNJPCoatingSwitch.Checked;
        }

        private void cbNDiagonalSwitch_CheckedChanged(object sender, EventArgs e)
        {
            tbNDiagonalMin.Enabled = cbNDiagonalSwitch.Checked;
            tbNDiagonalMax.Enabled = cbNDiagonalSwitch.Checked;
            tbNDiagonalStandard.Enabled = cbNDiagonalSwitch.Checked;
            tbNDiagonalName.Enabled = cbNDiagonalSwitch.Checked;
        }

        private void cbNLeftUpAngleSwitch_CheckedChanged(object sender, EventArgs e)
        {
            tbNLeftUpAngleMin.Enabled = cbNLeftUpAngleSwitch.Checked;
            tbNLeftUpAngleMax.Enabled = cbNLeftUpAngleSwitch.Checked;
            tbNLeftUpAngleStandard.Enabled = cbNLeftUpAngleSwitch.Checked;
            tbNLeftUpAngleName.Enabled = cbNLeftUpAngleSwitch.Checked;
        }

        private void cbNRightUpAngleSwitch_CheckedChanged(object sender, EventArgs e)
        {
            tbNRightUpAngleMin.Enabled = cbNRightUpAngleSwitch.Checked;
            tbNRightUpAngleMax.Enabled = cbNRightUpAngleSwitch.Checked;
            tbNRightUpAngleStandard.Enabled = cbNRightUpAngleSwitch.Checked;
            tbNRightUpAngleName.Enabled = cbNRightUpAngleSwitch.Checked;
        }

        private void cbNLeftDownAngleSwitch_CheckedChanged(object sender, EventArgs e)
        {
            tbNLeftDownAngleMin.Enabled = cbNLeftDownAngleSwitch.Checked;
            tbNLeftDownAngleMax.Enabled = cbNLeftDownAngleSwitch.Checked;
            tbNLeftDownAngleStandard.Enabled = cbNLeftDownAngleSwitch.Checked;
            tbNLeftDownAngleName.Enabled = cbNLeftDownAngleSwitch.Checked;
        }

        private void cbNRightDownAngleSwitch_CheckedChanged(object sender, EventArgs e)
        {
            tbNRightDownAngleMin.Enabled = cbNRightDownAngleSwitch.Checked;
            tbNRightDownAngleMax.Enabled = cbNRightDownAngleSwitch.Checked;
            tbNRightDownAngleStandard.Enabled = cbNRightDownAngleSwitch.Checked;
            tbNRightDownAngleName.Enabled = cbNRightDownAngleSwitch.Checked;
        }

        private void cbNLeftUpVAngleSwitch_CheckedChanged(object sender, EventArgs e)
        {
            tbNLeftUpVAngleMin.Enabled = cbNLeftUpVAngleSwitch.Checked;
            tbNLeftUpVAngleMax.Enabled = cbNLeftUpVAngleSwitch.Checked;
            tbNLeftUpVAngleStandard.Enabled = cbNLeftUpVAngleSwitch.Checked;
            tbNLeftUpVAngleName.Enabled = cbNLeftUpVAngleSwitch.Checked;
        }

        private void cbNLeftUpVWidthSwitch_CheckedChanged(object sender, EventArgs e)
        {
            tbNLeftUpVWidthMin.Enabled = cbNLeftUpVWidthSwitch.Checked;
            tbNLeftUpVWidthMax.Enabled = cbNLeftUpVWidthSwitch.Checked;
            tbNLeftUpVWidthStandard.Enabled = cbNLeftUpVWidthSwitch.Checked;
            tbNLeftUpVWidthName.Enabled = cbNLeftUpVWidthSwitch.Checked;
        }

        private void cbNLeftUpVDepthSwitch_CheckedChanged(object sender, EventArgs e)
        {
            tbNLeftUpVDepthMin.Enabled = cbNLeftUpVDepthSwitch.Checked;
            tbNLeftUpVDepthMax.Enabled = cbNLeftUpVDepthSwitch.Checked;
            tbNLeftUpVDepthStandard.Enabled = cbNLeftUpVDepthSwitch.Checked;
            tbNLeftUpVDepthName.Enabled = cbNLeftUpVDepthSwitch.Checked;
        }

        private void cbNRightUpVAngleSwitch_CheckedChanged(object sender, EventArgs e)
        {
            tbNRightUpVAngleMin.Enabled = cbNRightUpVAngleSwitch.Checked;
            tbNRightUpVAngleMax.Enabled = cbNRightUpVAngleSwitch.Checked;
            tbNRightUpVAngleStandard.Enabled = cbNRightUpVAngleSwitch.Checked;
            tbNRightUpVAngleName.Enabled = cbNRightUpVAngleSwitch.Checked;
        }

        private void cbNRightUpVWidthSwitch_CheckedChanged(object sender, EventArgs e)
        {
            tbNRightUpVWidthMin.Enabled = cbNRightUpVWidthSwitch.Checked;
            tbNRightUpVWidthMax.Enabled = cbNRightUpVWidthSwitch.Checked;
            tbNRightUpVWidthStandard.Enabled = cbNRightUpVWidthSwitch.Checked;
            tbNRightUpVWidthName.Enabled = cbNRightUpVWidthSwitch.Checked;
        }

        private void cbNRightUpVDepthSwitch_CheckedChanged(object sender, EventArgs e)
        {
            tbNRightUpVDepthMin.Enabled = cbNRightUpVDepthSwitch.Checked;
            tbNRightUpVDepthMax.Enabled = cbNRightUpVDepthSwitch.Checked;
            tbNRightUpVDepthStandard.Enabled = cbNRightUpVDepthSwitch.Checked;
            tbNRightUpVDepthName.Enabled = cbNRightUpVDepthSwitch.Checked;
        }

        private void cbNLeftDownVAngleSwitch_CheckedChanged(object sender, EventArgs e)
        {
            tbNLeftDownVAngleMin.Enabled = cbNLeftDownVAngleSwitch.Checked;
            tbNLeftDownVAngleMax.Enabled = cbNLeftDownVAngleSwitch.Checked;
            tbNLeftDownVAngleStandard.Enabled = cbNLeftDownVAngleSwitch.Checked;
            tbNLeftDownVAngleName.Enabled = cbNLeftDownVAngleSwitch.Checked;
        }

        private void cbNLeftDownVWidthSwitch_CheckedChanged(object sender, EventArgs e)
        {
            tbNLeftDownVWidthMin.Enabled = cbNLeftDownVWidthSwitch.Checked;
            tbNLeftDownVWidthMax.Enabled = cbNLeftDownVWidthSwitch.Checked;
            tbNLeftDownVWidthStandard.Enabled = cbNLeftDownVWidthSwitch.Checked;
            tbNLeftDownVWidthName.Enabled = cbNLeftDownVWidthSwitch.Checked;
        }

        private void cbNLeftDownVDepthSwitch_CheckedChanged(object sender, EventArgs e)
        {
            tbNLeftDownVDepthMin.Enabled = cbNLeftDownVDepthSwitch.Checked;
            tbNLeftDownVDepthMax.Enabled = cbNLeftDownVDepthSwitch.Checked;
            tbNLeftDownVDepthStandard.Enabled = cbNLeftDownVDepthSwitch.Checked;
            tbNLeftDownVDepthName.Enabled = cbNLeftDownVDepthSwitch.Checked;
        }

        private void cbNRightDownVAngleSwitch_CheckedChanged(object sender, EventArgs e)
        {
            tbNRightDownVAngleMin.Enabled = cbNRightDownVAngleSwitch.Checked;
            tbNRightDownVAngleMax.Enabled = cbNRightDownVAngleSwitch.Checked;
            tbNRightDownVAngleStandard.Enabled = cbNRightDownVAngleSwitch.Checked;
            tbNRightDownVAngleName.Enabled = cbNRightDownVAngleSwitch.Checked;
        }

        private void cbNRightDownVWidthSwitch_CheckedChanged(object sender, EventArgs e)
        {
            tbNRightDownVWidthMin.Enabled = cbNRightDownVWidthSwitch.Checked;
            tbNRightDownVWidthMax.Enabled = cbNRightDownVWidthSwitch.Checked;
            tbNRightDownVWidthStandard.Enabled = cbNRightDownVWidthSwitch.Checked;
            tbNRightDownVWidthName.Enabled = cbNRightDownVWidthSwitch.Checked;
        }

        private void cbNRightDownVDepthSwitch_CheckedChanged(object sender, EventArgs e)
        {
            tbNRightDownVDepthMin.Enabled = cbNRightDownVDepthSwitch.Checked;
            tbNRightDownVDepthMax.Enabled = cbNRightDownVDepthSwitch.Checked;
            tbNRightDownVDepthStandard.Enabled = cbNRightDownVDepthSwitch.Checked;
            tbNRightDownVDepthName.Enabled = cbNRightDownVDepthSwitch.Checked;
        }

        private void cbPJPHeadWidthSwitch_CheckedChanged(object sender, EventArgs e)
        {
            tbPJPHeadWidthMin.Enabled = cbPJPHeadWidthSwitch.Checked;
            tbPJPHeadWidthMax.Enabled = cbPJPHeadWidthSwitch.Checked;
            tbPJPHeadWidthStandard.Enabled = cbPJPHeadWidthSwitch.Checked;
            tbPJPHeadWidthName.Enabled = cbPJPHeadWidthSwitch.Checked;
        }

        private void cbPJPTailWidthSwitch_CheckedChanged(object sender, EventArgs e)
        {
            tbPJPTailWidthMin.Enabled = cbPJPTailWidthSwitch.Checked;
            tbPJPTailWidthMax.Enabled = cbPJPTailWidthSwitch.Checked;
            tbPJPTailWidthStandard.Enabled = cbPJPTailWidthSwitch.Checked;
            tbPJPTailWidthName.Enabled = cbPJPTailWidthSwitch.Checked;
        }

        private void cbPJPHeadLengthSwitch_CheckedChanged(object sender, EventArgs e)
        {
            tbPJPHeadLengthMin.Enabled = cbPJPHeadLengthSwitch.Checked;
            tbPJPHeadLengthMax.Enabled = cbPJPHeadLengthSwitch.Checked;
            tbPJPHeadLengthStandard.Enabled = cbPJPHeadLengthSwitch.Checked;
            tbPJPHeadLengthName.Enabled = cbPJPHeadLengthSwitch.Checked;
        }

        private void cbPJPTailLengthSwitch_CheckedChanged(object sender, EventArgs e)
        {
            tbPJPTailLengthMin.Enabled = cbPJPTailLengthSwitch.Checked;
            tbPJPTailLengthMax.Enabled = cbPJPTailLengthSwitch.Checked;
            tbPJPTailLengthStandard.Enabled = cbPJPTailLengthSwitch.Checked;
            tbPJPTailLengthName.Enabled = cbPJPTailLengthSwitch.Checked;
        }

        private void cbPJELeftShoulderSwitch_CheckedChanged(object sender, EventArgs e)
        {
            tbPJELeftShoulderMin.Enabled = cbPJELeftShoulderSwitch.Checked;
            tbPJELeftShoulderMax.Enabled = cbPJELeftShoulderSwitch.Checked;
            tbPJELeftShoulderStandard.Enabled = cbPJELeftShoulderSwitch.Checked;
            tbPJELeftShoulderName.Enabled = cbPJELeftShoulderSwitch.Checked;
        }

        private void cbPJERightShoulderSwitch_CheckedChanged(object sender, EventArgs e)
        {
            tbPJERightShoulderMin.Enabled = cbPJERightShoulderSwitch.Checked;
            tbPJERightShoulderMax.Enabled = cbPJERightShoulderSwitch.Checked;
            tbPJERightShoulderStandard.Enabled = cbPJERightShoulderSwitch.Checked;
            tbPJERightShoulderName.Enabled = cbPJERightShoulderSwitch.Checked;
        }

        private void cbPJEWidthSwitch_CheckedChanged(object sender, EventArgs e)
        {
            tbPJEWidthMin.Enabled = cbPJEWidthSwitch.Checked;
            tbPJEWidthMax.Enabled = cbPJEWidthSwitch.Checked;
            tbPJEWidthStandard.Enabled = cbPJEWidthSwitch.Checked;
            tbPJEWidthName.Enabled = cbPJEWidthSwitch.Checked;
        }

        private void cbPJEHeightSwitch_CheckedChanged(object sender, EventArgs e)
        {
            tbPJEHeightMin.Enabled = cbPJEHeightSwitch.Checked;
            tbPJEHeightMax.Enabled = cbPJEHeightSwitch.Checked;
            tbPJEHeightStandard.Enabled = cbPJEHeightSwitch.Checked;
            tbPJEHeightName.Enabled = cbPJEHeightSwitch.Checked;
        }

        private void cbPCeramicHeightSwitch_CheckedChanged(object sender, EventArgs e)
        {
            tbPCeramicHeightMin.Enabled = cbPCeramicHeightSwitch.Checked;
            tbPCeramicHeightMax.Enabled = cbPCeramicHeightSwitch.Checked;
            tbPCeramicHeightStandard.Enabled = cbPCeramicHeightSwitch.Checked;
            tbPCeramicHeightName.Enabled = cbPCeramicHeightSwitch.Checked;
        }

        private void cbPJPTotalWidthSwitch_CheckedChanged(object sender, EventArgs e)
        {
            tbPJPTotalWidthMin.Enabled = cbPJPTotalWidthSwitch.Checked;
            tbPJPTotalWidthMax.Enabled = cbPJPTotalWidthSwitch.Checked;
            tbPJPTotalWidthStandard.Enabled = cbPJPTotalWidthSwitch.Checked;
            tbPJPTotalWidthName.Enabled = cbPJPTotalWidthSwitch.Checked;
        }

        private void cbPJPCoatingSwitch_CheckedChanged(object sender, EventArgs e)
        {
            tbPJPCoatingMin.Enabled = cbPJPCoatingSwitch.Checked;
            tbPJPCoatingMax.Enabled = cbPJPCoatingSwitch.Checked;
            tbPJPCoatingStandard.Enabled = cbPJPCoatingSwitch.Checked;
            tbPJPCoatingName.Enabled = cbPJPCoatingSwitch.Checked;
        }

        private void cbPDiagonalSwitch_CheckedChanged(object sender, EventArgs e)
        {
            tbPDiagonalMin.Enabled = cbPDiagonalSwitch.Checked;
            tbPDiagonalMax.Enabled = cbPDiagonalSwitch.Checked;
            tbPDiagonalStandard.Enabled = cbPDiagonalSwitch.Checked;
            tbPDiagonalName.Enabled = cbPDiagonalSwitch.Checked;
        }

        private void cbPLeftUpAngleSwitch_CheckedChanged(object sender, EventArgs e)
        {
            tbPLeftUpAngleMin.Enabled = cbPLeftUpAngleSwitch.Checked;
            tbPLeftUpAngleMax.Enabled = cbPLeftUpAngleSwitch.Checked;
            tbPLeftUpAngleStandard.Enabled = cbPLeftUpAngleSwitch.Checked;
            tbPLeftUpAngleName.Enabled = cbPLeftUpAngleSwitch.Checked;
        }

        private void cbPRightUpAngleSwitch_CheckedChanged(object sender, EventArgs e)
        {
            tbPRightUpAngleMin.Enabled = cbPRightUpAngleSwitch.Checked;
            tbPRightUpAngleMax.Enabled = cbPRightUpAngleSwitch.Checked;
            tbPRightUpAngleStandard.Enabled = cbPRightUpAngleSwitch.Checked;
            tbPRightUpAngleName.Enabled = cbPRightUpAngleSwitch.Checked;
        }

        private void cbPLeftDownAngleSwitch_CheckedChanged(object sender, EventArgs e)
        {
            tbPLeftDownAngleMin.Enabled = cbPLeftDownAngleSwitch.Checked;
            tbPLeftDownAngleMax.Enabled = cbPLeftDownAngleSwitch.Checked;
            tbPLeftDownAngleStandard.Enabled = cbPLeftDownAngleSwitch.Checked;
            tbPLeftDownAngleName.Enabled = cbPLeftDownAngleSwitch.Checked;
        }

        private void cbPRightDownAngleSwitch_CheckedChanged(object sender, EventArgs e)
        {
            tbPRightDownAngleMin.Enabled = cbPRightDownAngleSwitch.Checked;
            tbPRightDownAngleMax.Enabled = cbPRightDownAngleSwitch.Checked;
            tbPRightDownAngleStandard.Enabled = cbPRightDownAngleSwitch.Checked;
            tbPRightDownAngleName.Enabled = cbPRightDownAngleSwitch.Checked;
        }

        private void cbPLeftUpVAngleSwitch_CheckedChanged(object sender, EventArgs e)
        {
            tbPLeftUpVAngleMin.Enabled = cbPLeftUpVAngleSwitch.Checked;
            tbPLeftUpVAngleMax.Enabled = cbPLeftUpVAngleSwitch.Checked;
            tbPLeftUpVAngleStandard.Enabled = cbPLeftUpVAngleSwitch.Checked;
            tbPLeftUpVAngleName.Enabled = cbPLeftUpVAngleSwitch.Checked;
        }

        private void cbPLeftUpVWidthSwitch_CheckedChanged(object sender, EventArgs e)
        {
            tbPLeftUpVWidthMin.Enabled = cbPLeftUpVWidthSwitch.Checked;
            tbPLeftUpVWidthMax.Enabled = cbPLeftUpVWidthSwitch.Checked;
            tbPLeftUpVWidthStandard.Enabled = cbPLeftUpVWidthSwitch.Checked;
            tbPLeftUpVWidthName.Enabled = cbPLeftUpVWidthSwitch.Checked;
        }

        private void cbPLeftUpVDepthSwitch_CheckedChanged(object sender, EventArgs e)
        {
            tbPLeftUpVDepthMin.Enabled = cbPLeftUpVDepthSwitch.Checked;
            tbPLeftUpVDepthMax.Enabled = cbPLeftUpVDepthSwitch.Checked;
            tbPLeftUpVDepthStandard.Enabled = cbPLeftUpVDepthSwitch.Checked;
            tbPLeftUpVDepthName.Enabled = cbPLeftUpVDepthSwitch.Checked;
        }

        private void cbPRightUpVAngleSwitch_CheckedChanged(object sender, EventArgs e)
        {
            tbPRightUpVAngleMin.Enabled = cbPRightUpVAngleSwitch.Checked;
            tbPRightUpVAngleMax.Enabled = cbPRightUpVAngleSwitch.Checked;
            tbPRightUpVAngleStandard.Enabled = cbPRightUpVAngleSwitch.Checked;
            tbPRightUpVAngleName.Enabled = cbPRightUpVAngleSwitch.Checked;
        }

        private void cbPRightUpVWidthSwitch_CheckedChanged(object sender, EventArgs e)
        {
            tbPRightUpVWidthMin.Enabled = cbPRightUpVWidthSwitch.Checked;
            tbPRightUpVWidthMax.Enabled = cbPRightUpVWidthSwitch.Checked;
            tbPRightUpVWidthStandard.Enabled = cbPRightUpVWidthSwitch.Checked;
            tbPRightUpVWidthName.Enabled = cbPRightUpVWidthSwitch.Checked;
        }

        private void cbPRightUpVDepthSwitch_CheckedChanged(object sender, EventArgs e)
        {
            tbPRightUpVDepthMin.Enabled = cbPRightUpVDepthSwitch.Checked;
            tbPRightUpVDepthMax.Enabled = cbPRightUpVDepthSwitch.Checked;
            tbPRightUpVDepthStandard.Enabled = cbPRightUpVDepthSwitch.Checked;
            tbPRightUpVDepthName.Enabled = cbPRightUpVDepthSwitch.Checked;
        }

        private void cbPLeftDownVAngleSwitch_CheckedChanged(object sender, EventArgs e)
        {
            tbPLeftDownVAngleMin.Enabled = cbPLeftDownVAngleSwitch.Checked;
            tbPLeftDownVAngleMax.Enabled = cbPLeftDownVAngleSwitch.Checked;
            tbPLeftDownVAngleStandard.Enabled = cbPLeftDownVAngleSwitch.Checked;
            tbPLeftDownVAngleName.Enabled = cbPLeftDownVAngleSwitch.Checked;
        }

        private void cbPLeftDownVWidthSwitch_CheckedChanged(object sender, EventArgs e)
        {
            tbPLeftDownVWidthMin.Enabled = cbPLeftDownVWidthSwitch.Checked;
            tbPLeftDownVWidthMax.Enabled = cbPLeftDownVWidthSwitch.Checked;
            tbPLeftDownVWidthStandard.Enabled = cbPLeftDownVWidthSwitch.Checked;
            tbPLeftDownVWidthName.Enabled = cbPLeftDownVWidthSwitch.Checked;
        }

        private void cbPLeftDownVDepthSwitch_CheckedChanged(object sender, EventArgs e)
        {
            tbPLeftDownVDepthMin.Enabled = cbPLeftDownVDepthSwitch.Checked;
            tbPLeftDownVDepthMax.Enabled = cbPLeftDownVDepthSwitch.Checked;
            tbPLeftDownVDepthStandard.Enabled = cbPLeftDownVDepthSwitch.Checked;
            tbPLeftDownVDepthName.Enabled = cbPLeftDownVDepthSwitch.Checked;
        }

        private void cbPRightDownVAngleSwitch_CheckedChanged(object sender, EventArgs e)
        {
            tbPRightDownVAngleMin.Enabled = cbPRightDownVAngleSwitch.Checked;
            tbPRightDownVAngleMax.Enabled = cbPRightDownVAngleSwitch.Checked;
            tbPRightDownVAngleStandard.Enabled = cbPRightDownVAngleSwitch.Checked;
            tbPRightDownVAngleName.Enabled = cbPRightDownVAngleSwitch.Checked;
        }

        private void cbPRightDownVWidthSwitch_CheckedChanged(object sender, EventArgs e)
        {
            tbPRightDownVWidthMin.Enabled = cbPRightDownVWidthSwitch.Checked;
            tbPRightDownVWidthMax.Enabled = cbPRightDownVWidthSwitch.Checked;
            tbPRightDownVWidthStandard.Enabled = cbPRightDownVWidthSwitch.Checked;
            tbPRightDownVWidthName.Enabled = cbPRightDownVWidthSwitch.Checked;
        }

        private void cbPRightDownVDepthSwitch_CheckedChanged(object sender, EventArgs e)
        {
            tbPRightDownVDepthMin.Enabled = cbPRightDownVDepthSwitch.Checked;
            tbPRightDownVDepthMax.Enabled = cbPRightDownVDepthSwitch.Checked;
            tbPRightDownVDepthStandard.Enabled = cbPRightDownVDepthSwitch.Checked;
            tbPRightDownVDepthName.Enabled = cbPRightDownVDepthSwitch.Checked;
        }

        private void cbNJEBevelLimitSwitch_CheckedChanged(object sender, EventArgs e)
        {
            //cbNJELocation.Enabled = cbNJEBevelLimitSwitch.Checked;
            tbNJEGrayMin.Enabled = cbNJEBevelLimitSwitch.Checked;
            tbNJEGrayMax.Enabled = cbNJEBevelLimitSwitch.Checked;
            tbNJEAreaStandard.Enabled = cbNJEBevelLimitSwitch.Checked;
            tbNJEAreaRange.Enabled = cbNJEBevelLimitSwitch.Checked;
            tbNJeOddmentsArea.Enabled = cbNJEBevelLimitSwitch.Checked;
            tbNJEColumnErosion.Enabled = cbNJEBevelLimitSwitch.Checked;
            tbNJERowErosion.Enabled = cbNJEBevelLimitSwitch.Checked;
            tbNJERectangularity.Enabled = cbNJEBevelLimitSwitch.Checked;
            tbNJEGapGrayMin.Enabled = cbNJEBevelLimitSwitch.Checked;
            tbNJEGapGrayMax.Enabled = cbNJEBevelLimitSwitch.Checked;
            tbNJEGapAreaMax.Enabled = cbNJEBevelLimitSwitch.Checked;
            tbNJEHeight.Enabled = cbNJEBevelLimitSwitch.Checked;
            tbNJEWidth.Enabled = cbNJEBevelLimitSwitch.Checked;

            tbNArcAreaMax_Up.Enabled = cbNJEBevelLimitSwitch.Checked;
            tbNArcAreaMax_Down.Enabled = cbNJEBevelLimitSwitch.Checked;
            tbNArcAreaMin_Down.Enabled = cbNJEBevelLimitSwitch.Checked;
            tbNArcGrayMin_Up.Enabled = cbNJEBevelLimitSwitch.Checked;

        }

        private void cbPJEBevelLimitSwitch_CheckedChanged(object sender, EventArgs e)
        {
            //cbPJELocation.Enabled = cbPJEBevelLimitSwitch.Checked;
            tbPJEGrayMin.Enabled = cbPJEBevelLimitSwitch.Checked;
            tbPJEGrayMax.Enabled = cbPJEBevelLimitSwitch.Checked;
            tbPJEAreaStandard.Enabled = cbPJEBevelLimitSwitch.Checked;
            tbPJEAreaRange.Enabled = cbPJEBevelLimitSwitch.Checked;
            tbPJeOddmentsArea.Enabled = cbPJEBevelLimitSwitch.Checked;
            tbPJEColumnErosion.Enabled = cbPJEBevelLimitSwitch.Checked;
            tbPJERowErosion.Enabled = cbPJEBevelLimitSwitch.Checked;
            tbPJERectangularity.Enabled = cbPJEBevelLimitSwitch.Checked;
            tbPJEGapGrayMin.Enabled = cbPJEBevelLimitSwitch.Checked;
            tbPJEGapGrayMax.Enabled = cbPJEBevelLimitSwitch.Checked;
            tbPJEGapAreaMax.Enabled = cbPJEBevelLimitSwitch.Checked;
            tbPJEHeight.Enabled = cbPJEBevelLimitSwitch.Checked;
            tbPJEWidth.Enabled = cbPJEBevelLimitSwitch.Checked;

            tbPArcAreaMax_Up.Enabled = cbPJEBevelLimitSwitch.Checked;
            tbPArcAreaMax_Down.Enabled = cbPJEBevelLimitSwitch.Checked;
            tbPArcAreaMin_Down.Enabled = cbPJEBevelLimitSwitch.Checked;
            tbPArcGrayMin_Up.Enabled = cbPJEBevelLimitSwitch.Checked;

        }

        private void cbNLeftUpBevelSwitch_CheckedChanged(object sender, EventArgs e)
        {
            tbNLeftUpBevelGrayMin.Enabled = cbNLeftUpBevelSwitch.Checked;
            tbNLeftUpBevelAreaMin.Enabled = cbNLeftUpBevelSwitch.Checked;
            tbNLeftUpBevelAreaMax.Enabled = cbNLeftUpBevelSwitch.Checked;
            tbNLeftUpBevelFrame.Enabled = cbNLeftUpBevelSwitch.Checked;
            tbNLeftUpBevelName.Enabled = cbNLeftUpBevelSwitch.Checked;

        }

        private void cbNRightUpBevelSwitch_CheckedChanged(object sender, EventArgs e)
        {
            tbNRightUpBevelGrayMin.Enabled = cbNRightUpBevelSwitch.Checked;
            tbNRightUpBevelAreaMin.Enabled = cbNRightUpBevelSwitch.Checked;
            tbNRightUpBevelAreaMax.Enabled = cbNRightUpBevelSwitch.Checked;
            tbNRightUpBevelFrame.Enabled = cbNRightUpBevelSwitch.Checked;
            tbNRightUpBevelName.Enabled = cbNRightUpBevelSwitch.Checked;
        }

        private void cbNLeftDownBevelSwitch_CheckedChanged(object sender, EventArgs e)
        {
            tbNLeftDownBevelGrayMin.Enabled = cbNLeftDownBevelSwitch.Checked;
            tbNLeftDownBevelAreaMin.Enabled = cbNLeftDownBevelSwitch.Checked;
            tbNLeftDownBevelAreaMax.Enabled = cbNLeftDownBevelSwitch.Checked;
            tbNLeftDownBevelFrame.Enabled = cbNLeftDownBevelSwitch.Checked;
            tbNLeftDownBevelName.Enabled = cbNLeftDownBevelSwitch.Checked;
        }

        private void cbNRightDownBevelSwitch_CheckedChanged(object sender, EventArgs e)
        {
            tbNRightDownBevelGrayMin.Enabled = cbNRightDownBevelSwitch.Checked;
            tbNRightDownBevelAreaMin.Enabled = cbNRightDownBevelSwitch.Checked;
            tbNRightDownBevelAreaMax.Enabled = cbNRightDownBevelSwitch.Checked;
            tbNRightDownBevelFrame.Enabled = cbNRightDownBevelSwitch.Checked;
            tbNRightDownBevelName.Enabled = cbNRightDownBevelSwitch.Checked;
        }

        private void cbPLeftUpBevelSwitch_CheckedChanged(object sender, EventArgs e)
        {
            tbPLeftUpBevelGrayMin.Enabled = cbPLeftUpBevelSwitch.Checked;
            tbPLeftUpBevelAreaMin.Enabled = cbPLeftUpBevelSwitch.Checked;
            tbPLeftUpBevelAreaMax.Enabled = cbPLeftUpBevelSwitch.Checked;
            tbPLeftUpBevelFrame.Enabled = cbPLeftUpBevelSwitch.Checked;
            tbPLeftUpBevelName.Enabled = cbPLeftUpBevelSwitch.Checked;
        }

        private void cbPRightUpBevelSwitch_CheckedChanged(object sender, EventArgs e)
        {
            tbPRightUpBevelGrayMin.Enabled = cbPRightUpBevelSwitch.Checked;
            tbPRightUpBevelAreaMin.Enabled = cbPRightUpBevelSwitch.Checked;
            tbPRightUpBevelAreaMax.Enabled = cbPRightUpBevelSwitch.Checked;
            tbPRightUpBevelFrame.Enabled = cbPRightUpBevelSwitch.Checked;
            tbPRightUpBevelName.Enabled = cbPRightUpBevelSwitch.Checked;
        }

        private void cbPLeftDownBevelSwitch_CheckedChanged(object sender, EventArgs e)
        {
            tbPLeftDownBevelGrayMin.Enabled = cbPLeftDownBevelSwitch.Checked;
            tbPLeftDownBevelAreaMin.Enabled = cbPLeftDownBevelSwitch.Checked;
            tbPLeftDownBevelAreaMax.Enabled = cbPLeftDownBevelSwitch.Checked;
            tbPLeftDownBevelFrame.Enabled = cbPLeftDownBevelSwitch.Checked;
            tbPLeftDownBevelName.Enabled = cbPLeftDownBevelSwitch.Checked;
        }

        private void cbPRightDownBevelSwitch_CheckedChanged(object sender, EventArgs e)
        {
            tbPRightDownBevelGrayMin.Enabled = cbPRightDownBevelSwitch.Checked;
            tbPRightDownBevelAreaMin.Enabled = cbPRightDownBevelSwitch.Checked;
            tbPRightDownBevelAreaMax.Enabled = cbPRightDownBevelSwitch.Checked;
            tbPRightDownBevelFrame.Enabled = cbPRightDownBevelSwitch.Checked;
            tbPRightDownBevelName.Enabled = cbPRightDownBevelSwitch.Checked;
        }

        private void bAddProductName_Click(object sender, EventArgs e)
        {
            if (tbName.Text == "") return;
            if (Directory.Exists($"Config\\{tbName.Text}"))
            {
                MessageBox.Show($"{tbName.Text}型号已存在，下方产品列表选中双击即可"); return;
            }
            if (MessageBox.Show($"是否新增产品型号:{tbName.Text}", "提示", MessageBoxButtons.OKCancel) == DialogResult.OK)
            {
                PublicSet.ProductNmae = $"{tbName.Text}";
                PublicSet.path = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, $"Config\\{PublicSet.ProductNmae}");//刷新路径
                Directory.CreateDirectory(PublicSet.path);
                PublicSet.SavaMeasureLine();
                PublicSet.SavaTuple();
                PublicSet.SaveFile(); PublicSet.SaveDataShowFile();

                string[] s = Directory.GetDirectories("Config");
                //清空产品列表
                dGVProductList.Rows.Clear();
                foreach (var item in s)//将上面字符串数组  S 依次传给 item
                {
                    string[] s1 = item.Split('\\');//依次分割
                    dGVProductList.Rows.Insert(0, s1[s1.Length - 1]);//依次添加到产品列表里
                }
                foreach (DataGridViewRow row in dGVProductList.Rows) // 遍历整个DataGridView
                {
                    if (row.Cells["ColName"].Value != null && row.Cells["ColName"].Value.ToString() == PublicSet.ProductNmae) // 与变量值比较
                    {
                        row.DefaultCellStyle.BackColor = Color.Green; // 设置背景颜色
                    }
                    else
                    {
                        row.DefaultCellStyle.BackColor = Color.White; // 设置默认背景颜色
                    }
                }
                lProductName.Text = $"当前产品型号：{PublicSet.ProductNmae}，在产品列表中双击即可切换型号";
                dGVProductList.ClearSelection();
            }
        }

        private void bUp_Click(object sender, EventArgs e)
        {
            //如果选中的是第一列则返回
            if (DGVDetectionItemPriority.CurrentCellAddress.X == 0) return;
            //如果选中的单元格不是空的，并且选中单元格所在行不是在第0行
            if (DGVDetectionItemPriority.CurrentCell != null && DGVDetectionItemPriority.CurrentRow.Index != 0)
            {   //获取选中单元格的值  
                object newrow = DGVDetectionItemPriority.CurrentCell.Value;
                //获取选中单元格的XY索引
                Point p = DGVDetectionItemPriority.CurrentCellAddress;
                //获取根据选中的单元格的Y索引得到上一个单元格的值
                object newrow1 = DGVDetectionItemPriority.Rows[p.Y - 1].Cells[p.X].Value;
                //将得到的两个值互换位置
                DGVDetectionItemPriority.CurrentCell.Value = newrow1;
                DGVDetectionItemPriority.Rows[p.Y - 1].Cells[p.X].Value = newrow;
                DGVDetectionItemPriority.ClearSelection();
                DGVDetectionItemPriority.Rows[p.Y - 1].Selected = true;
                DGVDetectionItemPriority.Rows[p.Y].Selected = false;
                //设置指定的单元格为选中状态
                DGVDetectionItemPriority.CurrentCell = DGVDetectionItemPriority.Rows[p.Y - 1].Cells[p.X];
            }
        }

        private void cbNJEBevelLimitSwitch1_CheckedChanged(object sender, EventArgs e)
        {
            tbNJEGrayMin1.Enabled = cbNJEBevelLimitSwitch1.Checked;
            tbNJEGrayMax1.Enabled = cbNJEBevelLimitSwitch1.Checked;
            tbNJEAreaStandard1.Enabled = cbNJEBevelLimitSwitch1.Checked;
            tbNJEAreaRange1.Enabled = cbNJEBevelLimitSwitch1.Checked;
            tbNJeOddmentsArea1.Enabled = cbNJEBevelLimitSwitch1.Checked;
            tbNJEColumnErosion1.Enabled = cbNJEBevelLimitSwitch1.Checked;
            tbNJERowErosion1.Enabled = cbNJEBevelLimitSwitch1.Checked;
            tbNJERectangularity1.Enabled = cbNJEBevelLimitSwitch1.Checked;
            tbNJEGapGrayMin1.Enabled = cbNJEBevelLimitSwitch1.Checked;
            tbNJEGapGrayMax1.Enabled = cbNJEBevelLimitSwitch1.Checked;
            tbNJEGapAreaMax1.Enabled = cbNJEBevelLimitSwitch1.Checked;
            tbNJEHeight1.Enabled = cbNJEBevelLimitSwitch1.Checked;
            tbNJEWidth1.Enabled = cbNJEBevelLimitSwitch1.Checked;

            tbNArcAreaMax_Up1.Enabled = cbNJEBevelLimitSwitch1.Checked;
            tbNArcAreaMax_Down1.Enabled = cbNJEBevelLimitSwitch1.Checked;
            tbNArcAreaMin_Down1.Enabled = cbNJEBevelLimitSwitch1.Checked;
            tbNArcGrayMin_Up1.Enabled = cbNJEBevelLimitSwitch1.Checked;
        }

        private void cbPJEBevelLimitSwitch1_CheckedChanged(object sender, EventArgs e)
        {
            tbPJEGrayMin1.Enabled = cbPJEBevelLimitSwitch1.Checked;
            tbPJEGrayMax1.Enabled = cbPJEBevelLimitSwitch1.Checked;
            tbPJEAreaStandard1.Enabled = cbPJEBevelLimitSwitch1.Checked;
            tbPJEAreaRange1.Enabled = cbPJEBevelLimitSwitch1.Checked;
            tbPJeOddmentsArea1.Enabled = cbPJEBevelLimitSwitch1.Checked;
            tbPJEColumnErosion1.Enabled = cbPJEBevelLimitSwitch1.Checked;
            tbPJERowErosion1.Enabled = cbPJEBevelLimitSwitch1.Checked;
            tbPJERectangularity1.Enabled = cbPJEBevelLimitSwitch1.Checked;
            tbPJEGapGrayMin1.Enabled = cbPJEBevelLimitSwitch1.Checked;
            tbPJEGapGrayMax1.Enabled = cbPJEBevelLimitSwitch1.Checked;
            tbPJEGapAreaMax1.Enabled = cbPJEBevelLimitSwitch1.Checked;
            tbPJEHeight1.Enabled = cbPJEBevelLimitSwitch1.Checked;
            tbPJEWidth1.Enabled = cbPJEBevelLimitSwitch1.Checked;

            tbPArcAreaMax_Up1.Enabled = cbPJEBevelLimitSwitch1.Checked;
            tbPArcAreaMax_Down1.Enabled = cbPJEBevelLimitSwitch1.Checked;
            tbPArcAreaMin_Down1.Enabled = cbPJEBevelLimitSwitch1.Checked;
            tbPArcGrayMin_Up1.Enabled = cbPJEBevelLimitSwitch1.Checked;
        }


        private void bDown_Click(object sender, EventArgs e)
        {
            //如果选中的是第一列则返回
            if (DGVDetectionItemPriority.CurrentCellAddress.X == 0) return;
            //如果选中的单元格不是空的，并且选中单元格所在行不是在第0行
            if (DGVDetectionItemPriority.CurrentCell != null && DGVDetectionItemPriority.CurrentRow.Index != DGVDetectionItemPriority.Rows.Count - 2)
            {   //获取选中单元格的值  
                object newrow = DGVDetectionItemPriority.CurrentCell.Value;
                //获取选中单元格的XY索引
                Point p = DGVDetectionItemPriority.CurrentCellAddress;
                //获取根据选中的单元格的Y索引得到上一个单元格的值
                object newrow1 = DGVDetectionItemPriority.Rows[p.Y + 1].Cells[p.X].Value;
                //将得到的两个值互换位置
                DGVDetectionItemPriority.CurrentCell.Value = newrow1;
                DGVDetectionItemPriority.Rows[p.Y + 1].Cells[p.X].Value = newrow;
                DGVDetectionItemPriority.ClearSelection();
                DGVDetectionItemPriority.Rows[p.Y + 1].Selected = true;
                DGVDetectionItemPriority.Rows[p.Y].Selected = false;
                //设置指定的单元格为选中状态
                DGVDetectionItemPriority.CurrentCell = DGVDetectionItemPriority.Rows[p.Y + 1].Cells[p.X];
            }
        }


        private void bDeleteProductName_Click(object sender, EventArgs e)
        {
            if (dGVProductList.CurrentRow.Cells["ColName"].Value.ToString() == PublicSet.ProductNmae)
            {
                MessageBox.Show($"{PublicSet.ProductNmae}正在使用无法删除，请切换其他型号后删除"); return;
            }
            if (MessageBox.Show($"是否删除型号：{dGVProductList.CurrentRow.Cells["ColName"].Value}", "提示", MessageBoxButtons.OKCancel) == DialogResult.OK)
            {
                Directory.Delete($"Config\\{dGVProductList.CurrentRow.Cells["ColName"].Value}", true);
                string[] s = Directory.GetDirectories("Config");
                //清空产品列表
                dGVProductList.Rows.Clear();
                foreach (var item in s)//将上面字符串数组  S 依次传给 item
                {
                    string[] s1 = item.Split('\\');//依次分割
                    dGVProductList.Rows.Insert(0, s1[s1.Length - 1]);//依次添加到产品列表里
                }
                foreach (DataGridViewRow row in dGVProductList.Rows) // 遍历整个DataGridView
                {
                    if (row.Cells["ColName"].Value != null && row.Cells["ColName"].Value.ToString() == PublicSet.ProductNmae) // 与变量值比较
                    {
                        row.DefaultCellStyle.BackColor = Color.Green; // 设置背景颜色
                    }
                    else
                    {
                        row.DefaultCellStyle.BackColor = Color.White; // 设置默认背景颜色
                    }
                }
                lProductName.Text = $"当前产品型号：{PublicSet.ProductNmae}，在产品列表中双击即可切换型号";
                dGVProductList.ClearSelection();
            }
        }

        private void dGVProductList_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e)
        {
            if (PublicSet.ProductNmae == dGVProductList.CurrentRow.Cells["ColName"].Value.ToString())
            {
                MessageBox.Show($"当前已是型号：{PublicSet.ProductNmae}"); return;
            }
            if (!Directory.Exists($"Config\\{dGVProductList.CurrentRow.Cells["ColName"].Value}"))
            {
                MessageBox.Show($"型号：{dGVProductList.CurrentRow.Cells["ColName"].Value}已被删除无法切换"); return;
            }
            if (MessageBox.Show($"是否切换型号：{dGVProductList.CurrentRow.Cells["ColName"].Value}", "提示", MessageBoxButtons.OKCancel) == DialogResult.OK)
            {
                PublicSet.ProductNmae = dGVProductList.CurrentRow.Cells["ColName"].Value.ToString();
                PublicSet.path = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, $"Config\\{PublicSet.ProductNmae}");//刷新路径
                PublicSet.LoadSet();
                PublicSet.GetTuple();

                foreach (DataGridViewRow row in dGVProductList.Rows) // 遍历整个DataGridView
                {
                    if (row.Cells["ColName"].Value != null && row.Cells["ColName"].Value.ToString() == PublicSet.ProductNmae) // 与变量值比较
                    {
                        row.DefaultCellStyle.BackColor = Color.Green; // 设置背景颜色
                    }
                    else
                    {
                        row.DefaultCellStyle.BackColor = Color.White; // 设置默认背景颜色
                    }
                }
                Tool.LogSystemRuning("已切换型号：" + PublicSet.ProductNmae);
                lProductName.Text = $"当前产品型号：{PublicSet.ProductNmae}，在产品列表中双击即可切换型号";
                dGVProductList.ClearSelection();
            }
        }

        private void cbNMarkSwitch_CheckedChanged(object sender, EventArgs e)
        {
            tbNMarkMin.Enabled = cbNMarkSwitch.Checked;
            tbNMarkMax.Enabled = cbNMarkSwitch.Checked;
        }

        private void cbPMarkSwitch_CheckedChanged(object sender, EventArgs e)
        {
            tbPMarkMin.Enabled = cbPMarkSwitch.Checked;
            tbPMarkMax.Enabled = cbPMarkSwitch.Checked;
        }

        private void bicon_Click(object sender, EventArgs e)
        {
            OpenFileDialog Dlg = new OpenFileDialog();//实例化打开文件对话框的对象
            Dlg.Filter = "(*.ico)|*.ico";//打开文件的格式
            //是否允许选择多个文件
            Dlg.Multiselect = false;
            if (Dlg.ShowDialog() == DialogResult.OK)
            {
                tbiconFileName.Text = Dlg.FileName;
            }
        }

        private void bpic_Click(object sender, EventArgs e)
        {
            OpenFileDialog Dlg = new OpenFileDialog();//实例化打开文件对话框的对象
            Dlg.Filter = "(*.bmp;*.png;*.jpg;*.jpeg;*.tif;*.ico)|*.bmp;*.png;*.jpg;*.jpeg;*.tif;*.ico";//打开文件的格式
            //是否允许选择多个文件
            Dlg.Multiselect = false;
            if (Dlg.ShowDialog() == DialogResult.OK)
            {
                tbpicFileName.Text = Dlg.FileName;
            }
        }
    }
}
